diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 668730f36e..167b8be1c8 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -182,8 +182,14 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { Apply(Select(Ident(ex), "key"), List()), Object_eq), List(Ident(key))), - Apply(Select(Ident(ex), "value"), List()), - Throw(Ident(ex))); + Apply( + TypeApply( + Select( + Apply(Select(Ident(ex), "value"), List()), + Any_asInstanceOf), + List(TypeTree(meth.tpe.finalResultType))), + List()), + Throw(Ident(ex))) val keyDef = ValDef(key, New(TypeTree(ObjectClass.tpe), List(List()))) val tryCatch = Try(body, List(CaseDef(pat, EmptyTree, rhs)), EmptyTree) Block(List(keyDef), tryCatch) |