From 458adadcaf6e89f1cd876fe58cffc1343936d66d Mon Sep 17 00:00:00 2001 From: Gilles Dubochet Date: Wed, 6 Jun 2007 18:04:53 +0000 Subject: The AST “Literal(Constant(t))” for t a value ty... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The AST “Literal(Constant(t))” for t a value type (int et al.) compiles consistently accross compilation targets. --- src/compiler/scala/tools/nsc/transform/CleanUp.scala | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index c4658c361c..a734078614 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -292,22 +292,25 @@ abstract class CleanUp extends Transform { /* end of dynamic call transformer. */ - case Template(parents, self, body) if (settings.target.value != "jvm-1.5" && !forMSIL) => //what is that? - classConstantMeth.clear - newDefs.clear + case Template(parents, self, body) => localTyper = typer.atOwner(tree, currentOwner) - val body1 = transformTrees(body) - copy.Template(tree, parents, self, newDefs.toList ::: body1) - case Literal(c) if (c.tag == ClassTag) && (settings.target.value != "jvm-1.5" && !forMSIL) => //what is that? + if (settings.target.value != "jvm-1.5" && !forMSIL) { + classConstantMeth.clear + newDefs.clear + val body1 = transformTrees(body) + copy.Template(tree, parents, self, newDefs.toList ::: body1) + } else super.transform(tree) + case Literal(c) if (c.tag == ClassTag) => val tpe = c.typeValue atPos(tree.pos) { localTyper.typed { if (isValueClass(tpe.symbol)) Select(gen.mkAttributedRef(javaBoxClassModule(tpe.symbol)), "TYPE") - else + else if (settings.target.value != "jvm-1.5" && !forMSIL) Apply( gen.mkAttributedRef(classConstantMethod(tree.pos, signature(tpe))), List()) + else tree } } case _ => -- cgit v1.2.3