diff options
author | Martin Odersky <odersky@gmail.com> | 2017-04-12 15:39:54 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-04-18 16:55:39 +0200 |
commit | d355f8fe28218b1e8b984d6d491f02c414e922d5 (patch) | |
tree | 0e6f9163b1c8a2b08508937f4868a016f5424b00 /compiler/src/dotty/tools/dotc | |
parent | ab124cb8cda3ab65b0195f1a7f74006c24ebe7ab (diff) | |
download | dotty-d355f8fe28218b1e8b984d6d491f02c414e922d5.tar.gz dotty-d355f8fe28218b1e8b984d6d491f02c414e922d5.tar.bz2 dotty-d355f8fe28218b1e8b984d6d491f02c414e922d5.zip |
Dealias before type erasing
... and likewise for taking a signature. The previous case worked
in all cases except when faced with an alias like `type Id[T] = T`.
In that case, it would disregard the argument and erase to Object.
Diffstat (limited to 'compiler/src/dotty/tools/dotc')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/TypeErasure.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala index f35752644..02f1f549f 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala @@ -355,7 +355,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean * - For NoType or NoPrefix, the type itself. * - For any other type, exception. */ - private def apply(tp: Type)(implicit ctx: Context): Type = tp match { + private def apply(tp: Type)(implicit ctx: Context): Type = tp.dealias match { case _: ErasedValueType => tp case tp: TypeRef => @@ -487,7 +487,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean * Need to ensure correspondence with erasure! */ private def sigName(tp: Type)(implicit ctx: Context): TypeName = try { - tp match { + tp.dealias match { case ErasedValueType(_, underlying) => sigName(underlying) case tp: TypeRef => |