有没有人有处理这些类型的编译错误的经验?
case class BasicAuthRequest[A](account: Account, request: Request[A]) extends WrappedRequest(request) {
def asOpt[T](implicit fjs: Reads[T]): Option[T] = {
catching(classOf[RuntimeException]).opt(fjs.reads(JsNull)).filter {
case JsUndefined(_) => false
case _ => true
} }
}
尝试编译此 playframework 方法时,我从 scala 编译器得到此响应
[error] found : play.api.libs.json.JsUndefined
[error] required: play.api.libs.json.JsResult[?T1] where type ?T1 <: T (this is a GADT skolem)
[error] case JsUndefined(_) => false
[error] ^
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 23 s, completed Nov 27, 2012 3:01:20 AM