summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2007-05-02 11:07:48 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2007-05-02 11:07:48 +0000
commitc57c0d9c773fc6cdc3105a3b762d086d46b95640 (patch)
treee8505dd2faa4f02b7b6375d946eb34b135dd0803 /src/compiler
parentf48b4737957877464bfc486b09d58a855c929fe5 (diff)
downloadscala-c57c0d9c773fc6cdc3105a3b762d086d46b95640.tar.gz
scala-c57c0d9c773fc6cdc3105a3b762d086d46b95640.tar.bz2
scala-c57c0d9c773fc6cdc3105a3b762d086d46b95640.zip
Martin: should normalize return ErrorType for a...
Martin: should normalize return ErrorType for a type alias applied to the wrong number of arguments? (right now, it does nothing, which leads to cycles) small change to normalize in TypeRef -- still possible to get cycles with type alias that's applied to wrong number of arguments (or before this commit, if info wasn't complete yet)
Diffstat (limited to 'src/compiler')
-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 1ed48c2eb9..bfd83eaff6 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1201,11 +1201,14 @@ A type's symbol should never be inspected directly.
override def normalize =
if (sym.isAliasType) {
- if (sym.info.typeParams.length == args.length) // beta-reduce
+ if (sym.info.typeParams.length == args.length || !sym.info.isComplete) // beta-reduce -- check if the info has been loaded, if not, the arity check is meaningless
transform(sym.info.resultType).normalize // cycles have been checked in typeRef
else if (isHigherKinded)
PolyType(typeParams, transform(sym.info.resultType).normalize)
- else this
+ else {
+ log("normalizing "+this+" with mismatch between type params "+sym.info.typeParams+" and args "+args)
+ this
+ }
} else if (isHigherKinded) {
PolyType(typeParams, typeRef(pre, sym, higherKindedArgs)) // @M TODO: transform?
} else super.normalize // @M TODO: transform?