summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala10
-rw-r--r--src/library/scala/Predef.scala2
2 files changed, 9 insertions, 3 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)
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala
index 6af6f273ce..9985a4f855 100644
--- a/src/library/scala/Predef.scala
+++ b/src/library/scala/Predef.scala
@@ -129,7 +129,7 @@ object Predef {
implicit def stringWrapper(x: String) = new runtime.RichString(x)
- implicit def any2stringadd(x: String) = new runtime.StringAdd(x)
+ implicit def any2stringadd(x: Any) = new runtime.StringAdd(x)
implicit def exceptionWrapper(exc: Throwable) = new runtime.RichException(exc)