From ee560229d1be78294b17ba4b0b6f36e8dd68d376 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 13 Feb 2012 14:27:41 +0100 Subject: Fixing problems with generation of isInstanceOf, classOf. --- src/compiler/scala/tools/nsc/transform/Erasure.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index debf2e4b97..7eb819f058 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -583,7 +583,7 @@ abstract class Erasure extends AddInterfaces case Apply(TypeApply(sel @ Select(qual, name), List(targ)), List()) if tree.symbol == Any_isInstanceOf || tree.symbol == Object_asInstanceOf => targ.tpe match { - case ErasedInlineType(clazz) => targ.setType(scalaErasure(clazz.tpe)) + case ErasedInlineType(clazz) => targ.setType(clazz.tpe) case _ => } tree @@ -1065,7 +1065,11 @@ abstract class Erasure extends AddInterfaces case Literal(ct) if ct.tag == ClassTag && ct.typeValue.typeSymbol != definitions.UnitClass => - treeCopy.Literal(tree, Constant(erasure(NoSymbol, ct.typeValue))) + val erased = ct.typeValue match { + case TypeRef(pre, clazz, args) if clazz.isInlineClass => typeRef(pre, clazz, List()) + case tpe => erasure(NoSymbol, tpe) + } + treeCopy.Literal(tree, Constant(erased)) case _ => tree -- cgit v1.2.3