Struct kailua_check::env::Env [] [src]

pub struct Env<'ctx, R: 'ctx> { /* fields omitted */ }

A per-file environment which depends to Context.

Methods

impl<'ctx, R: Report> Env<'ctx, R>
[src]

Returns a pair of type flags that is an exact lower and upper bound for that type.

Used as an approximate type bound testing like arithmetics. If possible, however, better be replaced with a non-instantiating assertion though.

Exactly resolves the type variable inside ty if possible.

This is a requirement for table indexing and function calls.

Same to Slot::accept but also able to handle the built-in semantics; should be used for any kind of non-internal assignments.

Same to Env::assign but the slot is assumed to be newly created (out of field) and the strict equality instead of subtyping is applied.

This is required because the slot itself is generated before doing any assignment; the usual notion of accepting by subtyping does not work well here. This is technically two assignments, of which the latter is done via the strict equality.

Returns a resulting slot. (This is important for some features relying on the strict referential slot identity, e.g. delayed type checking.)

Ensures that the variable has been initialized (possibly implicitly to nil). Raises an appropriate error when the implicit initialization was impossible.

Adds a local variable with the explicit type specinfo and the implicit type initinfo.

Returns the resulting slot of that variable, if the variable has been indeed added. The slot is referentially identical to what one will get from using it as an r-value.

Adds a local variable with that has been already initialized with the type info.

This is necessary for non-assignment statements that introduce a new variable without assignment semantics. Currently function arguments are the only such case.

Returns the resulting slot of that variable. The slot is referentially identical to what one will get from using it as an r-value.

Assigns to a global or local variable with a right-hand-side type of info.

This may create a new global variable if there is no variable with that name.

Returns the slot of that variable. The slot is referentially identical to what one will get from using it as an r-value.

Adds a new global or local variable with given type. It entirely skips the assignment phase and forces the variable to be exactly that type.

Returns the resulting slot of that variable. The slot is referentially identical to what one will get from using it as an r-value.

Trait Implementations

impl<'ctx, R: Report> Report for Env<'ctx, R>
[src]

impl<'ctx, R: Report> TypeResolver for Env<'ctx, R>
[src]

Returns an immutable reference to associated type context.

Returns a mutable reference to associated type context.

Resolves a type name to a type if any. The span is used for error reporting.

Resolves a class system name to an identifier if any. The span is used for error reporting.