-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
object CustomHandler {
def apply[T](): PartialFunction[Throwable, T] = ???
}
try {} catch CustomHandler()
should be valid code. Instead, it reports a warning with no Position.
Note, that this code:
object CustomHandler {
def apply[T](): PartialFunction[Throwable, T] = ???
}
try {} catch {
case _: Throwable => ???
}
try {} catch CustomHandler()
generates almost the same CaseDef
s
//case _: Throwable
case (_: Throwable) => scala.Predef.???
//CustomHandler()
case (x$1 @ (_: Throwable)) => {
<artifact> val catchExpr$1: PartialFunction[Throwable,Nothing] = CustomHandler.apply[Nothing]();
if (catchExpr$1.isDefinedAt(x$1))
catchExpr$1.apply(x$1)
else
throw x$1
}
Metadata
Metadata
Assignees
Labels
No labels