summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-11-17 20:24:21 +0000
committerMartin Odersky <odersky@gmail.com>2007-11-17 20:24:21 +0000
commitac55b8a3c32eb837080e7f39fa3eeeb68a5e2014 (patch)
tree1036bb63198fe4ac5d4c750ac53df4986c3f5a76 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent3818b76a0d280d28316b1607698163c8da4f7a67 (diff)
downloadscala-ac55b8a3c32eb837080e7f39fa3eeeb68a5e2014.tar.gz
scala-ac55b8a3c32eb837080e7f39fa3eeeb68a5e2014.tar.bz2
scala-ac55b8a3c32eb837080e7f39fa3eeeb68a5e2014.zip
Fixed #214, #217, #218
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 6340b9bafd..96f7c4be4d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1419,7 +1419,7 @@ trait Typers { self: Analyzer =>
||
pt.typeSymbol == PartialFunctionClass &&
fun.vparams.length == 1 && fun.body.isInstanceOf[Match])
- && // see bug901 for a reason why next conditions are neeed
+ && // see bug901 for a reason why next conditions are neeed
(pt.normalize.typeArgs.length - 1 == fun.vparams.length
||
fun.vparams.exists(_.tpt.isEmpty)))
@@ -1435,10 +1435,8 @@ trait Typers { self: Analyzer =>
val vparamSyms = List.map2(fun.vparams, argpts) { (vparam, argpt) =>
if (vparam.tpt.isEmpty)
vparam.tpt.tpe =
- if (argpt == NoType || argpt == WildcardType) {
- error(vparam.pos, "missing parameter type"); ErrorType
- }
- else argpt
+ if (isFullyDefined(argpt)) argpt
+ else { error(vparam.pos, "missing parameter type"); ErrorType }
enterSym(context, vparam)
if (context.retyping) context.scope enter vparam.symbol
vparam.symbol
@@ -2165,7 +2163,7 @@ trait Typers { self: Analyzer =>
.setOriginal(tpt1) /* .setPos(tpt1.pos) */
.setType(appliedType(tpt1.tpe, context.undetparams map (_.tpe)))
}
- if (tpt1.tpe.typeSymbol hasFlag ABSTRACT)
+ if (!tpt1.tpe.typeSymbol.isClass || (tpt1.tpe.typeSymbol hasFlag ABSTRACT))
error(tree.pos, tpt1.tpe.typeSymbol + " is abstract; cannot be instantiated")
else if (tpt1.tpe.typeSymbol.thisSym != tpt1.tpe.typeSymbol &&
!(tpt1.tpe <:< tpt1.tpe.typeOfThis) &&