File tree 2 files changed +2
-1
lines changed
compiler/src/dotty/tools/dotc 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class ExpandSAMs extends MiniPhase {
46
46
tree
47
47
case tpe =>
48
48
val tpe1 = checkRefinements(tpe, fn)
49
+ assert(! tpe1.isRef(defn.AnyClass ), " Tree: " + tree.show + " @ " + tree.sourcePos)
49
50
val Seq (samDenot) = tpe1.abstractTermMembers.filter(! _.symbol.isSuperAccessor)
50
51
cpy.Block (tree)(stats,
51
52
AnonClass (tpe1 :: Nil , fn.symbol.asTerm :: Nil , samDenot.symbol.asTerm.name :: Nil ))
Original file line number Diff line number Diff line change @@ -515,7 +515,7 @@ class Typer extends Namer
515
515
case templ : untpd.Template =>
516
516
import untpd ._
517
517
var templ1 = templ
518
- def isEligible (tp : Type ) = tp.exists && ! tp.typeSymbol.is(Final ) && tp.classSymbol != defn.AnyClass
518
+ def isEligible (tp : Type ) = tp.exists && ! tp.typeSymbol.is(Final ) && ! tp.isRef( defn.AnyClass )
519
519
if (templ1.parents.isEmpty &&
520
520
isFullyDefined(pt, ForceDegree .noBottom) &&
521
521
isEligible(pt.underlyingClassRef(refinementOK = false )))
You can’t perform that action at this time.
0 commit comments