From 06b373878a044e0a83e5162bca661a6050957d04 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Tue, 17 Jul 2012 18:04:23 +0200 Subject: SI-5731 a few fixes for value classes I've faced two gotchas. First of all posterasure, which is supposed to erase ErasedValueType types, didn't look into ConstantType.value that is known to be smuggling types (hi Paul that's a plus one). Secondly ClassManifest.classType[T] assumed that its T is bound by AnyRef, which is not the case for value types. Here I had two choices: a) introduce a special method for manifests of value types, b) remove the upper bound of the type parameter and call it a day. Since manifests are already deprecated and there's no difference which method was used to create which manifest, I went for option b). --- src/reflect/scala/reflect/internal/Constants.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/reflect') diff --git a/src/reflect/scala/reflect/internal/Constants.scala b/src/reflect/scala/reflect/internal/Constants.scala index 820dfe0868..d6a168ee11 100644 --- a/src/reflect/scala/reflect/internal/Constants.scala +++ b/src/reflect/scala/reflect/internal/Constants.scala @@ -221,7 +221,12 @@ trait Constants extends api.Constants { tag match { case NullTag => "null" case StringTag => "\"" + escape(stringValue) + "\"" - case ClazzTag => "classOf[" + signature(typeValue) + "]" + case ClazzTag => + def show(tpe: Type) = "classOf[" + signature(tpe) + "]" + typeValue match { + case ErasedValueType(orig) => show(orig) + case _ => show(typeValue) + } case CharTag => "'" + escapedChar(charValue) + "'" case LongTag => longValue.toString() + "L" case EnumTag => symbolValue.name.toString() -- cgit v1.2.3