summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-03-23 15:29:29 +0100
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-03-23 18:27:57 +0100
commite54eb1a14945eb289159d202be63830d243ab723 (patch)
treeecbfce305e542e67bb14089856e529fb4cb4bb10 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parente33950ccaa3dd7597c46956a29c1e2a859bb32be (diff)
downloadscala-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
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala5
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)
}