1
有沒有人有處理這些類型的編譯錯誤的經驗?Scala GADT Skolem Playframework 2.1編譯錯誤。
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