Skip to content

Commit 90066dc

Browse files
committed
refine condition for checking override
1 parent 947d10a commit 90066dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,12 +810,14 @@ class RefChecks extends MiniPhase { thisTransformer =>
810810
cls.owner.info.baseClasses.exists(_.info.member(cls.name).exists)
811811
}
812812

813+
val errors = ctx.reporter.errorCount
814+
813815
// If owner is possibly problematic, check owner first.
814816
// If there are overriding errors with owner, stop checking current to avoid cyclic reference.
815817
// See neg/i1750.scala.
816818
if (ownerPossibleProblematic(cls)) checkAllOverrides(cls.owner)
817819

818-
if (!ctx.reporter.hasErrors) checkAllOverrides(cls)
820+
if (ctx.reporter.errorCount == errors) checkAllOverrides(cls)
819821
tree
820822
} catch {
821823
case ex: MergeError =>

0 commit comments

Comments
 (0)