Struct kailua_check::Checker [] [src]

pub struct Checker<'inp, 'envr, 'env: 'envr, R: 'env> { /* fields omitted */ }

The actual type checker.

This depends on both the per-file context Env (which in turn depends on the global context Context) and also a lifetime of the input chunk. Therefore the checker is actually per-file, but it internally creates nested Env and checkers to load other modules.

Methods

impl<'inp, 'envr, 'env, R: Report> Checker<'inp, 'envr, 'env, R>
[src]

Creates a new checker from the per-file context.

Type-checks a given chunk (here is same to the top-level block).

Requires a given module name and returns the resulting module. Essentially same to the specialized require(modname) call, and normally used to provide the preloaded environment. (Use Context::open_library for preloading --# open, by the way.)

There are two spans associated: the name span and the expression span. The former span is used to pinpoint the problematic module name from the reports; the latter span is used to track the require call (e.g. recursive require).

Returns the resulting module (that may have diverged, in which case returns is None) or None when the error occurred and has been recovered.