@@ -256,10 +256,12 @@ object Checking {
256
256
(effs2 ++ effs).toList.flatMap(check(_))
257
257
}
258
258
259
- // / Check if we can just directly promote a potential.
260
- // / A potential can be (currently) directly promoted if and only if:
261
- // / - `pot == this` and all fields of this are initialized, or
262
- // / - `pot == Warm(C, outer)` where `outer` can be directly promoted.
259
+ /**
260
+ * Check if we can just directly promote a potential.
261
+ * A potential can be (currently) directly promoted if and only if:
262
+ * - `pot == this` and all fields of this are initialized, or
263
+ * - `pot == Warm(C, outer)` where `outer` can be directly promoted.
264
+ */
263
265
private def canDirectlyPromote (pot : Potential , visited : Set [Potential ] = Set .empty)(using state : State ): Boolean = trace(" checking direct promotion of " + pot.show, init) {
264
266
if (state.safePromoted.contains(pot)) true
265
267
// If this potential's promotion depends on itself, we cannot directly promote it.
@@ -282,18 +284,20 @@ object Checking {
282
284
}
283
285
}
284
286
285
- // / Check the Promotion of a Warm object, according to "Rule 2":
286
- //
287
- // Rule 2: Promote(pot)
288
- //
289
- // for all concrete methods `m` of D
290
- // pot.m!, Promote(pot.m)
291
- //
292
- // for all concrete fields `f` of D
293
- // Promote(pot.f)
294
- //
295
- // for all inner classes `F` of D
296
- // Warm[F, pot].init!, Promote(Warm[F, pot])
287
+ /**
288
+ * Check the Promotion of a Warm object, according to "Rule 2":
289
+ *
290
+ * Rule 2: Promote(pot)
291
+ *
292
+ * for all concrete methods `m` of D
293
+ * pot.m!, Promote(pot.m)
294
+ *
295
+ * for all concrete fields `f` of D
296
+ * Promote(pot.f)
297
+ *
298
+ * for all inner classes `F` of D
299
+ * Warm[F, pot].init!, Promote(Warm[F, pot])
300
+ */
297
301
private def checkPromoteWarm (warm : Warm , eff : Effect )(using state : State ): Errors =
298
302
val Warm (cls, outer) = warm
299
303
val source = eff.source
0 commit comments