Env

dotty.tools.dotc.transform.init.Objects.Env
object Env

Environment for parameters

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Env.type

Members list

Type members

Classlikes

abstract class Data

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object NoEnv
object NoEnv extends Data

Attributes

Supertypes
class Data
class Object
trait Matchable
class Any
Self type
NoEnv.type

Value members

Concrete methods

def emptyEnv(meth: Symbol)(using Context): Data

An empty environment can be used for non-method environments, e.g., field initializers.

An empty environment can be used for non-method environments, e.g., field initializers.

The owner for the local environment for field initializers is the primary constructor of the enclosing class.

Attributes

def getVal(x: Symbol)(using data: Data, ctx: Context): Option[Value]
def getVar(x: Symbol)(using data: Data, ctx: Context): Option[Addr]
def of(ddef: DefDef, args: List[Value], outer: Data)(using Context): Data
def resolveEnv(meth: Symbol, thisV: ThisValue, env: Data)(using Context): Option[(ThisValue, Data)]

Resolve the environment owned by the given method.

Resolve the environment owned by the given method.

The method could be located in outer scope with intermixed classes between its definition site and usage site.

Due to widening, the corresponding environment might not exist. As a result reading the local variable will return Cold and it's forbidden to write to the local variable.

Value parameters

env

The local environment where the local variable is referenced.

meth

The method which owns the environment

thisV

The value for this of the enclosing class where the local variable is referenced.

Attributes

Returns

the environment and value for this owned by the given method.

def setLocalVal(x: Symbol, value: Value)(using data: Data, ctx: Context): Unit
def setLocalVar(x: Symbol, addr: Addr)(using data: Data, ctx: Context): Unit
def valValue(x: Symbol)(using data: Data, ctx: Context, trace: Trace): Value
def withEnv[T](env: Data)(fn: Data ?=> T): T