Does anyone have some experience dealing with these types of compilation errors?
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
} }
}
I get this response from the scala compiler when attempting to compile this playframework method
[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
fjs.reads(JsNull) returns JsResult[T] which is then wrapped into Option by opt
so there are couple of issues with this code:
here is the code I think you were trying to implement