Skip to content

Commit ef76448

Browse files
committed
Remove unsound skip
Static calls should be checked unless the instance class is defined in a separate module. This is because the static call in library may contain virtual calls to the current project.
1 parent 224732b commit ef76448

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/init/CycleChecker.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class CycleChecker(cache: Cache) {
186186
deps.flatMap(check(_))
187187

188188
private def checkStaticCall(dep: StaticCall)(using Context, State): List[Error] =
189-
if !classesInCurrentRun.contains(dep.cls) || !classesInCurrentRun.contains(dep.symbol.owner) then
189+
if !classesInCurrentRun.contains(dep.cls) then
190190
Util.traceIndented("skip " + dep.show + " which is not in current run ", init)
191191
Nil
192192
else if !dep.symbol.hasSource then
@@ -197,7 +197,7 @@ class CycleChecker(cache: Cache) {
197197
}
198198

199199
private def checkProxyUsage(dep: ProxyUsage)(using Context, State): List[Error] =
200-
if !classesInCurrentRun.contains(dep.cls) || !classesInCurrentRun.contains(dep.symbol.owner) then
200+
if !classesInCurrentRun.contains(dep.cls) then
201201
Util.traceIndented("skip " + dep.show + " which is not in current run ", init)
202202
Nil
203203
else if !dep.symbol.hasSource then

0 commit comments

Comments
 (0)