Skip to content

Commit f09cae9

Browse files
committed
Any does not qualify for parent class
1 parent 9a07924 commit f09cae9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ class Typer extends Namer
515515
case templ: untpd.Template =>
516516
import untpd._
517517
var templ1 = templ
518-
def isEligible(tp: Type) = tp.exists && !tp.typeSymbol.is(Final)
518+
def isEligible(tp: Type) = tp.exists && !tp.typeSymbol.is(Final) && tp.classSymbol != defn.AnyClass
519519
if (templ1.parents.isEmpty &&
520520
isFullyDefined(pt, ForceDegree.noBottom) &&
521521
isEligible(pt.underlyingClassRef(refinementOK = false)))

0 commit comments

Comments
 (0)