summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-07-25 14:23:37 +0000
committerMartin Odersky <odersky@gmail.com>2007-07-25 14:23:37 +0000
commit95eaa29b50cd8de56c798a6461d933d763a946fc (patch)
treea33342171c69455e661b27cb419748a9a852d533 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentfd3697ed00c1bb3f454869627176bb388aecf9ee (diff)
downloadscala-95eaa29b50cd8de56c798a6461d933d763a946fc.tar.gz
scala-95eaa29b50cd8de56c798a6461d933d763a946fc.tar.bz2
scala-95eaa29b50cd8de56c798a6461d933d763a946fc.zip
fixed bug 1241
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 701b2fe245..e054f41900 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2938,9 +2938,11 @@ trait Typers { self: Analyzer =>
/** Types a type constructor tree used in a new or supertype */
def typedTypeConstructor(tree: Tree): Tree = {
val result = typed(tree, TYPEmode | FUNmode, WildcardType)
- if (!phase.erasedTypes && result.tpe.isInstanceOf[TypeRef] && !result.tpe.prefix.isStable)
- error(tree.pos, result.tpe.prefix+" is not a legal prefix for a constructor")
- result setType(result.tpe) // @M: normalization is done during erasure
+ val restpe = result.tpe.normalize
+ if (!phase.erasedTypes && restpe.isInstanceOf[TypeRef] && !restpe.prefix.isStable) {
+ error(tree.pos, restpe.prefix+" is not a legal prefix for a constructor")
+ }
+ result setType restpe // @M: normalization is done during erasure
}
def computeType(tree: Tree, pt: Type): Type = {