summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2007-05-02 21:25:49 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2007-05-02 21:25:49 +0000
commitd1c4f9e32b3f12f6f03b58be671f24b775c4ae9f (patch)
tree273aecb50e1a17c8aaa22aad4be4a67b044610e4
parent41b90d5719f1cf19108b0107965493ca53b56ce8 (diff)
downloadscala-d1c4f9e32b3f12f6f03b58be671f24b775c4ae9f.tar.gz
scala-d1c4f9e32b3f12f6f03b58be671f24b775c4ae9f.tar.bz2
scala-d1c4f9e32b3f12f6f03b58be671f24b775c4ae9f.zip
fixed bug with type alias expansion that turned...
fixed bug with type alias expansion that turned up when an old-style type constructor alias (e.g. type Class = java.lang.Class in Predef) was compiled without the new checks (in the example, without -Xgenerics), and now it's used with the checks (with -Xgenerics). Then, normalize didn't do anything (as the number of type params didn't coincide with the number of type arguments). I.e., it returned `this', which resulted in an infinite recursion.
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index bfd83eaff6..1c31a09bb9 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1206,8 +1206,11 @@ A type's symbol should never be inspected directly.
else if (isHigherKinded)
PolyType(typeParams, transform(sym.info.resultType).normalize)
else {
- log("normalizing "+this+" with mismatch between type params "+sym.info.typeParams+" and args "+args)
- this
+ log("Error: normalizing "+this+" with mismatch between type params "+sym.info.typeParams+" and args "+args)
+ //this
+ transform(sym.info.resultType).normalize // technically wrong, but returning `this' is even worse (cycle!)
+ // only happens when compiling `val x: Class' with -Xgenerics,
+ // when `type Class = java.lang.Class' has already been compiled (without -Xgenerics)
}
} else if (isHigherKinded) {
PolyType(typeParams, typeRef(pre, sym, higherKindedArgs)) // @M TODO: transform?