diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-03-23 15:29:29 +0100 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-03-23 18:27:57 +0100 |
commit | e54eb1a14945eb289159d202be63830d243ab723 (patch) | |
tree | ecbfce305e542e67bb14089856e529fb4cb4bb10 | |
parent | e33950ccaa3dd7597c46956a29c1e2a859bb32be (diff) | |
download | scala-e54eb1a14945eb289159d202be63830d243ab723.tar.gz scala-e54eb1a14945eb289159d202be63830d243ab723.tar.bz2 scala-e54eb1a14945eb289159d202be63830d243ab723.zip |
typedMatchAnonFun's missingCase call use apply's arg
can't pass the scrutinee since its type has been widened
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index eecf36487c..d91b58be82 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2227,7 +2227,10 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { anonClass setInfo ClassInfoType(parents, newScope, anonClass) methodSym setInfoAndEnter MethodType(paramSyms, resTp) - val body = methodBodyTyper.translateMatch(selector1, selectorTp, casesAdapted, resTp, doTranslation, if (isPartial) Some(scrut => (funThis DOT nme.missingCase) (scrut)) else None) + // use apply's parameter since the scrut's type has been widened + def missingCase(scrut_ignored: Tree) = (funThis DOT nme.missingCase) (REF(paramSyms.head)) + + val body = methodBodyTyper.translateMatch(selector1, selectorTp, casesAdapted, resTp, doTranslation, if (isPartial) Some(missingCase) else None) DefDef(methodSym, body) } |