From a8cd662ce26e915fb045bfd34b7ac9aa88f69721 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 8 Nov 2014 12:05:54 +0100 Subject: Fixed handling of ThisTypes in TypeErasure. Need to be treated like TermRefs. --- src/dotty/tools/dotc/TypeErasure.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/dotty/tools/dotc/TypeErasure.scala b/src/dotty/tools/dotc/TypeErasure.scala index 448dd3f57..4a492560f 100644 --- a/src/dotty/tools/dotc/TypeErasure.scala +++ b/src/dotty/tools/dotc/TypeErasure.scala @@ -108,6 +108,8 @@ object TypeErasure { case tp: TermRef => assert(tp.symbol.exists, tp) TermRef(erasedRef(tp.prefix), tp.symbol.asTerm) + case tp: ThisType => + tp case tp => erasure(tp) } @@ -271,7 +273,7 @@ class TypeErasure(isJava: Boolean, isSemi: Boolean, isConstructor: Boolean, wild case tp: TermRef => this(tp.widen) case ThisType(_) => - tp + this(tp.widen) case SuperType(thistpe, supertpe) => SuperType(this(thistpe), this(supertpe)) case ExprType(rt) => -- cgit v1.2.3