Checking

object Checking
class Object
trait Matchable
class Any

Type members

Classlikes

case class State(var visited: Set[Effect], path: Vector[Tree], thisClass: ClassSymbol, fieldsInited: Set[Symbol], parentsInited: Set[ClassSymbol], safePromoted: Set[Potential], env: Env)

The checking state

The checking state

Why visited is a set of effects instead of Symbol? Think the following program:

class C(x: Int, a: A @cold) {
  val n = if (x > 0) new C(x - 1, a).m() else 0
  val b: Int = this.m()
  def m(): Int = b
}

Value members

Concrete methods

def checkClassBody(cdef: TypeDef)(using state: State): Unit

Check that the given concrete class may be initialized safely

Check that the given concrete class may be initialized safely

It assumes that all definitions are properly summarized before-hand. However, summarization can be done lazily on-demand to improve performance.

Givens

Givens

given theCtx
given theEnv