We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c6cf39 commit ce826eeCopy full SHA for ce826ee
src/dotty/tools/dotc/TypeErasure.scala
@@ -31,7 +31,7 @@ object TypeErasure {
31
*/
32
def isErasedType(tp: Type)(implicit ctx: Context): Boolean = tp match {
33
case tp: TypeRef =>
34
- tp.symbol.isClass
+ tp.symbol.isClass && tp.symbol != defn.AnyClass
35
case _: TermRef =>
36
true
37
case JavaArrayType(elem) =>
@@ -168,7 +168,7 @@ object TypeErasure {
168
def loop(bcs: List[ClassSymbol], bestSoFar: ClassSymbol): ClassSymbol = bcs match {
169
case bc :: bcs1 =>
170
if (cls2.derivesFrom(bc))
171
- if (!bc.is(Trait)) bc
+ if (!bc.is(Trait) && bc != defn.AnyClass) bc
172
else loop(bcs1, if (bestSoFar.derivesFrom(bc)) bestSoFar else bc)
173
else
174
loop(bcs1, bestSoFar)
0 commit comments