Skip to content

Commit dc16bad

Browse files
committed
Fixed handling of ThisTypes in TypeErasure.
Need to be treated like TermRefs.
1 parent dbd9393 commit dc16bad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/dotty/tools/dotc/TypeErasure.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ object TypeErasure {
108108
case tp: TermRef =>
109109
assert(tp.symbol.exists, tp)
110110
TermRef(erasedRef(tp.prefix), tp.symbol.asTerm)
111+
case tp: ThisType =>
112+
tp
111113
case tp =>
112114
erasure(tp)
113115
}
@@ -271,7 +273,7 @@ class TypeErasure(isJava: Boolean, isSemi: Boolean, isConstructor: Boolean, wild
271273
case tp: TermRef =>
272274
this(tp.widen)
273275
case ThisType(_) =>
274-
tp
276+
this(tp.widen)
275277
case SuperType(thistpe, supertpe) =>
276278
SuperType(this(thistpe), this(supertpe))
277279
case ExprType(rt) =>

0 commit comments

Comments
 (0)