diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2008-05-17 15:04:41 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2008-05-17 15:04:41 +0000 |
commit | 3e58057fd1dd2149b5c63ad053986948fe2da691 (patch) | |
tree | d06b65f4fe78ad7d65bea46043781187a462bc6d /src/compiler | |
parent | 154a80dda6a853e25ac7a01e7a13552a3b32ee41 (diff) | |
download | scala-3e58057fd1dd2149b5c63ad053986948fe2da691.tar.gz scala-3e58057fd1dd2149b5c63ad053986948fe2da691.tar.bz2 scala-3e58057fd1dd2149b5c63ad053986948fe2da691.zip |
Fixed classOf problems (issues #841, #876).
Updated manifests.check to reflect the new way 'void' is represented.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/CleanUp.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 59ba3f4e90..c4a7240144 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -528,7 +528,8 @@ abstract class CleanUp extends Transform { val tpe = c.typeValue atPos(tree.pos) { localTyper.typed { - if (isValueClass(tpe.typeSymbol) && !forCLDC) + if ((isValueClass(tpe.typeSymbol) || tpe.typeSymbol == definitions.UnitClass) + && !forCLDC) Select(gen.mkAttributedRef(javaBoxClassModule(tpe.typeSymbol)), "TYPE") else if (settings.target.value != "jvm-1.5" && !forMSIL) Apply( diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index d58213f18b..3e738873a8 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -875,6 +875,10 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer { case Match(selector, cases) => Match(Typed(selector, TypeTree(selector.tpe)), cases) + case Literal(ct) if ct.tag == ClassTag + && ct.typeValue.typeSymbol != definitions.UnitClass => + copy.Literal(tree, Constant(erasure(ct.typeValue))) + case _ => tree } |