summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-07-28 10:00:31 +0000
committerMartin Odersky <odersky@gmail.com>2008-07-28 10:00:31 +0000
commitd492b489b176a3d2a4da0d199756af86514be352 (patch)
treee5cf7bedfa037a03f0fbf1bb72564114473edef0 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentc8b3af98b9dd45a358332f60e3bc8f5b8b3c604a (diff)
downloadscala-d492b489b176a3d2a4da0d199756af86514be352.tar.gz
scala-d492b489b176a3d2a4da0d199756af86514be352.tar.bz2
scala-d492b489b176a3d2a4da0d199756af86514be352.zip
fixed #842, #945, #83, #996, #1016, + some perf...
fixed #842, #945, #83, #996, #1016, + some performace tuning.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 6974684ac2..d410bf6eee 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2963,10 +2963,10 @@ trait Typers { self: Analyzer =>
def typedAppliedTypeTree(tpt: Tree, args: List[Tree]) = {
val tpt1 = typed1(tpt, mode | FUNmode | TAPPmode, WildcardType)
- // @S: shouldn't be necessary now, fixed a problem with SimpleTypeProxy not relaying typeParams calls.
- // if (inIDE) tpt1.symbol.info // @S: seems like typeParams call doesn't force completion of symbol type in IDE.
if (tpt1.tpe.isError) {
setError(tree)
+ } else if (!tpt1.hasSymbol) {
+ errorTree(tree, tpt1.tpe+" does not take type parameters")
} else {
val tparams = tpt1.symbol.typeParams
if (tparams.length == args.length) {
@@ -3280,7 +3280,7 @@ trait Typers { self: Analyzer =>
tree.tpe = null
if (tree.hasSymbol) tree.symbol = NoSymbol
}
- //Console.println("typing "+tree+", "+context.undetparams);//DEBUG
+// Console.println("typing "+tree+", "+context.undetparams);//DEBUG
def dropExistential(tp: Type): Type = tp match {
case ExistentialType(tparams, tpe) =>
if (settings.debug.value) println("drop ex "+tree+" "+tp)
@@ -3291,14 +3291,13 @@ trait Typers { self: Analyzer =>
if (tp1 eq tp0) tp else tp1
case _ => tp
}
-// Console.println("typing "+tree+" at "+tree.pos);//DEBUG
var tree1 = if (tree.tpe ne null) tree else typed1(tree, mode, dropExistential(pt))
-// Console.println("typed "+tree1+":"+tree1.tpe+", "+context.undetparams);//DEBUG
+// Console.println("typed "+tree1+":"+tree1.tpe+", "+context.undetparams);//DEBUG
tree1.tpe = addAnnotations(tree1, tree1.tpe)
val result = if (tree1.isEmpty || (inIDE && tree1.tpe == null)) tree1 else adapt(tree1, mode, pt)
-// Console.println("adapted "+tree1+":"+tree1.tpe+" to "+pt+", "+context.undetparams);//DEBUG
+// Console.println("adapted "+tree1+":"+tree1.tpe+" to "+pt+", "+context.undetparams);//DEBUG
// if ((mode & TYPEmode) != 0) println("type: "+tree1+" has type "+tree1.tpe)
result
} catch {