diff options
author | Martin Odersky <odersky@gmail.com> | 2007-03-06 00:12:17 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-03-06 00:12:17 +0000 |
commit | 9c97b8998bb3a1add3b5f7b9a78de553c9bbbd13 (patch) | |
tree | ff8675b9f742c86e567ba6e5e8a08fead1604ad0 | |
parent | 69a8cebb64fddaffe9059126cca0b35718d28bf8 (diff) | |
download | scala-9c97b8998bb3a1add3b5f7b9a78de553c9bbbd13.tar.gz scala-9c97b8998bb3a1add3b5f7b9a78de553c9bbbd13.tar.bz2 scala-9c97b8998bb3a1add3b5f7b9a78de553c9bbbd13.zip |
Fixed bug901
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index cbd691ae3d..1ebb6cb451 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1256,10 +1256,14 @@ trait Typers requires Analyzer { val codeExpected = !forCLDC && !forMSIL && (pt.symbol isNonBottomSubClass CodeClass) def decompose(pt: Type): (Symbol, List[Type], Type) = - if (isFunctionType(pt) - || - pt.symbol == PartialFunctionClass && - fun.vparams.length == 1 && fun.body.isInstanceOf[Match]) + if ((isFunctionType(pt) + || + pt.symbol == PartialFunctionClass && + fun.vparams.length == 1 && fun.body.isInstanceOf[Match]) + && // see bug901 for a reason why next conditions are neeed + (pt.typeArgs.length - 1 == fun.vparams.length + || + fun.vparams.exists(.tpt.isEmpty))) (pt.symbol, pt.typeArgs.init, pt.typeArgs.last) else (FunctionClass(fun.vparams.length), fun.vparams map (x => NoType), WildcardType) |