diff options
author | Martin Odersky <odersky@gmail.com> | 2017-04-12 23:56:57 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-04-18 16:55:39 +0200 |
commit | 02cffa49ede84dbd0dbb93329c9a4117251ca658 (patch) | |
tree | f89c3e21581c66b911eeb82ffa89fea49c3a3bb8 /compiler/src/dotty | |
parent | d355f8fe28218b1e8b984d6d491f02c414e922d5 (diff) | |
download | dotty-02cffa49ede84dbd0dbb93329c9a4117251ca658.tar.gz dotty-02cffa49ede84dbd0dbb93329c9a4117251ca658.tar.bz2 dotty-02cffa49ede84dbd0dbb93329c9a4117251ca658.zip |
Alternative fix
Special case HKApply only. This is simpler and potentially
more efficient.
Diffstat (limited to 'compiler/src/dotty')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/TypeErasure.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala index 02f1f549f..1eb90b8eb 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.dealias match { + private def apply(tp: Type)(implicit ctx: Context): Type = tp match { case _: ErasedValueType => tp case tp: TypeRef => @@ -377,6 +377,8 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean defn.FunctionType(0) case AndType(tp1, tp2) => erasedGlb(this(tp1), this(tp2), isJava) + case tp: HKApply => + apply(tp.superType) case OrType(tp1, tp2) => ctx.typeComparer.orType(this(tp1), this(tp2), erased = true) case tp: MethodType => @@ -487,7 +489,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.dealias match { + tp match { case ErasedValueType(_, underlying) => sigName(underlying) case tp: TypeRef => @@ -508,6 +510,8 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean normalizeClass(sym.asClass).fullName.asTypeName case defn.ArrayOf(elem) => sigName(this(tp)) + case tp: HKApply => + sigName(tp.superType) case JavaArrayType(elem) => sigName(elem) ++ "[]" case tp: TermRef => |