1
0

config: fix warning

This commit is contained in:
Wesley W. Terpstra 2017-09-12 12:22:47 -07:00
parent 17ba209ed0
commit 6fa5250e1f

View File

@ -10,8 +10,10 @@ abstract class Field[T] private (val default: Option[T])
abstract class View { abstract class View {
final def apply[T](pname: Field[T]): T = apply(pname, this) final def apply[T](pname: Field[T]): T = apply(pname, this)
final def apply[T](pname: Field[T], site: View): T = find(pname, site) match { final def apply[T](pname: Field[T], site: View): T = {
case Some(x) => x.asInstanceOf[T] val out = find(pname, site)
require (out.isDefined, s"Key ${pname} is not defined in Parameters")
out.get
} }
final def lift[T](pname: Field[T]): Option[T] = lift(pname, this) final def lift[T](pname: Field[T]): Option[T] = lift(pname, this)