Skip to content

Commit faf948f

Browse files
committed
Refactor coditions
1 parent d8e778d commit faf948f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
138138
/** Is a reference to a class but not `this.type` */
139139
def isClassRef = sym.isClass && !tp.isInstanceOf[ThisType]
140140

141-
if (sym.exists && !sym.isStaticOwner && !isClassRef && !levelOK(sym))
141+
if (!sym.exists || levelOK(sym))
142+
None
143+
else if (!sym.isStaticOwner && !isClassRef)
142144
tryHeal(sym, tp, pos)
143-
else if (sym.exists && !sym.owner.isStaticOwner && !levelOK(sym)) // local class reference that is phase
145+
else if (!sym.owner.isStaticOwner) // local class reference that is phase
144146
levelError(sym, tp, pos, "")
145147
else
146148
None

0 commit comments

Comments
 (0)