diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2007-07-20 12:27:22 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2007-07-20 12:27:22 +0000 |
commit | f3c134a70b0c0094eb0193c85987ee13a68b5a49 (patch) | |
tree | 5a805f285dfc9ceb05b7e5adcacda63ba8351a8f | |
parent | bd9874055fa2fbd2d848e59973c2b6b87f0e1fac (diff) | |
download | scala-f3c134a70b0c0094eb0193c85987ee13a68b5a49.tar.gz scala-f3c134a70b0c0094eb0193c85987ee13a68b5a49.tar.bz2 scala-f3c134a70b0c0094eb0193c85987ee13a68b5a49.zip |
a better fix than in r12370: delaying normaliza...
a better fix than in r12370: delaying normalization of T in classOf[T]
until it is actually necessary (in toTypeKind)
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala index 5e552faddb..1bf5455a13 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala @@ -380,7 +380,7 @@ trait TypeKinds { self: ICodes => /** Return the TypeKind of the given type */ - def toTypeKind(t: Type): TypeKind = t match { + def toTypeKind(t: Type): TypeKind = t.normalize match { case ThisType(sym) => REFERENCE(sym) case SingleType(pre, sym) => diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 6370eb244d..5799e3f494 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2070,7 +2070,8 @@ trait Typers { self: Analyzer => if (fun.symbol == Predef_classOf) { if (!targs.head.typeSymbol.isClass || targs.head.typeSymbol.isRefinementClass) error(args.head.pos, "class type required"); - Literal(Constant(targs.head.normalize)) setPos tree.pos setType ClassClass.tpe + Literal(Constant(targs.head)) setPos tree.pos setType ClassClass.tpe + // @M: targs.head.normalize is not necessary --> toTypeKind eventually normalizes the type } else { val resultpe0 = restpe.instantiateTypeParams(tparams, targs) //@M TODO -- probably ok |