Skip to content

Commit 714a8d7

Browse files
committed
refine condition for checking override
1 parent 947d10a commit 714a8d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,10 @@ class RefChecks extends MiniPhase { thisTransformer =>
813813
// If owner is possibly problematic, check owner first.
814814
// If there are overriding errors with owner, stop checking current to avoid cyclic reference.
815815
// See neg/i1750.scala.
816+
val errors = ctx.reporter.errorCount
816817
if (ownerPossibleProblematic(cls)) checkAllOverrides(cls.owner)
818+
if (ctx.reporter.errorCount == errors) checkAllOverrides(cls)
817819

818-
if (!ctx.reporter.hasErrors) checkAllOverrides(cls)
819820
tree
820821
} catch {
821822
case ex: MergeError =>

0 commit comments

Comments
 (0)