@@ -65,12 +65,18 @@ case class InstanceUsage(symbol: Symbol)(val source: Tree) extends Dependency {
65
65
*
66
66
* The method can be either on a static object or on a hot object.
67
67
* The target of the call is determined statically.
68
+ *
69
+ * Note: Virtual method resolution should have been performed for the target.
70
+ *
68
71
*/
69
72
case class StaticCall (cls : ClassSymbol , symbol : Symbol )(val source : Tree ) extends Dependency {
70
73
def show (using Context ): String = " StaticCall(" + cls.show + " , " + symbol.show + " )"
71
74
}
72
75
73
- /** A static method call result is used */
76
+ /** A static method call result is used
77
+ *
78
+ * Note: Virtual method resolution should have been performed for the target.
79
+ */
74
80
case class ProxyUsage (cls : ClassSymbol , symbol : Symbol )(val source : Tree ) extends Dependency {
75
81
def show (using Context ): String = " ProxyUsage(" + cls.show + " , " + symbol.show + " )"
76
82
}
@@ -166,17 +172,17 @@ class CycleChecker(cache: Cache) {
166
172
}
167
173
168
174
private def checkStaticCall (dep : StaticCall )(using Context , State ): List [Error ] =
169
- if ! classesInCurrentRun.contains(dep.cls) then
170
- Util .traceIndented(" skip " + dep.cls. show + " which is not in current run " , init)
175
+ if ! classesInCurrentRun.contains(dep.cls) || ! classesInCurrentRun.contains(dep.symbol.owner) then
176
+ Util .traceIndented(" skip " + dep.show + " which is not in current run " , init)
171
177
Nil
172
178
else {
173
179
val deps = methodDependencies(dep)
174
180
deps.flatMap(check(_))
175
181
}
176
182
177
183
private def checkProxyUsage (dep : ProxyUsage )(using Context , State ): List [Error ] =
178
- if ! classesInCurrentRun.contains(dep.cls) then
179
- Util .traceIndented(" skip " + dep.cls. show + " which is not in current run " , init)
184
+ if ! classesInCurrentRun.contains(dep.cls) || ! classesInCurrentRun.contains(dep.symbol.owner) then
185
+ Util .traceIndented(" skip " + dep.show + " which is not in current run " , init)
180
186
Nil
181
187
else {
182
188
val deps = proxyDependencies(dep)
@@ -239,8 +245,7 @@ class CycleChecker(cache: Cache) {
239
245
}
240
246
241
247
val pot = Hot (dep.cls)(dep.source)
242
- val target = Util .resolve(dep.cls, dep.symbol)
243
- val effs = pot.potentialsOf(target)(using env).promote(dep.source)
248
+ val effs = pot.potentialsOf(dep.symbol)(using env).promote(dep.source)
244
249
245
250
val errs = effs.flatMap(Checking .check(_)(using state))
246
251
assert(errs.isEmpty, " unexpected errors: " + Errors .show(errs.toList))
@@ -355,8 +360,7 @@ class CycleChecker(cache: Cache) {
355
360
}
356
361
357
362
val pot = Hot (dep.cls)(dep.source)
358
- val target = Util .resolve(dep.cls, dep.symbol)
359
- val effs = pot.effectsOf(target)(using env)
363
+ val effs = pot.effectsOf(dep.symbol)(using env)
360
364
361
365
val errs = effs.flatMap(Checking .check(_)(using state))
362
366
assert(errs.isEmpty, " unexpected errors: " + Errors .show(errs.toList))
0 commit comments