Skip to content

Commit 567d249

Browse files
committed
Add assertion to debug community build stdlib 2.13
1 parent f7eeddb commit 567d249

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class ExpandSAMs extends MiniPhase {
4646
tree
4747
case tpe =>
4848
val tpe1 = checkRefinements(tpe, fn)
49+
assert(!tpe1.isRef(defn.AnyClass), "Tree: " + tree.show + " @ " + tree.sourcePos)
4950
val Seq(samDenot) = tpe1.abstractTermMembers.filter(!_.symbol.isSuperAccessor)
5051
cpy.Block(tree)(stats,
5152
AnonClass(tpe1 :: Nil, fn.symbol.asTerm :: Nil, samDenot.symbol.asTerm.name :: Nil))

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) && tp.classSymbol != defn.AnyClass
518+
def isEligible(tp: Type) = tp.exists && !tp.typeSymbol.is(Final) && !tp.isRef(defn.AnyClass)
519519
if (templ1.parents.isEmpty &&
520520
isFullyDefined(pt, ForceDegree.noBottom) &&
521521
isEligible(pt.underlyingClassRef(refinementOK = false)))

0 commit comments

Comments
 (0)