diff --git a/src/dotty/tools/dotc/core/TypeErasure.scala b/src/dotty/tools/dotc/core/TypeErasure.scala index 92e32d4b1c12..01c47d1357c2 100644 --- a/src/dotty/tools/dotc/core/TypeErasure.scala +++ b/src/dotty/tools/dotc/core/TypeErasure.scala @@ -308,12 +308,8 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean val parent = tp.parent if (parent isRef defn.ArrayClass) eraseArray(tp) else this(parent) - case tp: TermRef => + case _: TermRef | _: ThisType => this(tp.widen) - case tp: ThisType => - def thisTypeErasure(tpToErase: Type) = - erasureFn(isJava, semiEraseVCs = false, isConstructor, wildcardOK)(tpToErase) - thisTypeErasure(tp.cls.typeRef) case SuperType(thistpe, supertpe) => SuperType(this(thistpe), this(supertpe)) case ExprType(rt) => diff --git a/src/dotty/tools/dotc/transform/Erasure.scala b/src/dotty/tools/dotc/transform/Erasure.scala index 962297517fad..5b6420aa224d 100644 --- a/src/dotty/tools/dotc/transform/Erasure.scala +++ b/src/dotty/tools/dotc/transform/Erasure.scala @@ -271,6 +271,7 @@ object Erasure extends TypeTestsCasts{ def erasedType(tree: untpd.Tree, semiEraseVCs: Boolean = true)(implicit ctx: Context): Type = tree.typeOpt match { case tp: TermRef if tree.isTerm => erasedRef(tp) + case tp: ThisType => tp case tp => erasure(tp, semiEraseVCs) } diff --git a/tests/pending/run/unittest_collection.check b/tests/pending/run/unittest_collection.check deleted file mode 100644 index df1629dd7eb1..000000000000 --- a/tests/pending/run/unittest_collection.check +++ /dev/null @@ -1 +0,0 @@ -warning: there was one deprecation warning; re-run with -deprecation for details diff --git a/tests/pending/run/unittest_collection.scala b/tests/run/unittest_collection.scala similarity index 86% rename from tests/pending/run/unittest_collection.scala rename to tests/run/unittest_collection.scala index d10845475b74..5db9b56d2bdc 100644 --- a/tests/pending/run/unittest_collection.scala +++ b/tests/run/unittest_collection.scala @@ -4,11 +4,11 @@ object Test { def main(args: Array[String]): Unit = { test(collection.mutable.ArrayBuffer[String]()) - test(collection.mutable.ListBuffer[String]()) - class BBuf(z:ListBuffer[String]) extends BufferProxy[String] { - def self = z - } - test(new BBuf(collection.mutable.ListBuffer[String]())) +// test(collection.mutable.ListBuffer[String]()) +// class BBuf(z:ListBuffer[String]) extends BufferProxy[String] { +// def self = z +// } +// test(new BBuf(collection.mutable.ListBuffer[String]())) } def test(x: Buffer[String]): Unit = {