[][src]Struct gluon_check::typecheck::Typecheck

pub struct Typecheck<'a> { /* fields omitted */ }

Struct which provides methods to typecheck expressions.

Methods

impl<'a> Typecheck<'a>[src]

pub fn new(
    module: String,
    symbols: &'a mut Symbols,
    environment: &'a (dyn TypecheckEnv<Type = ArcType> + 'a),
    interner: &TypeCache<Symbol, ArcType>,
    metadata: &'a mut FnvMap<Symbol, Arc<Metadata>>
) -> Typecheck<'a>
[src]

Create a new typechecker which typechecks expressions in module

pub fn typecheck_expr(
    &mut self,
    expr: &mut SpannedExpr<Symbol>
) -> Result<ArcType, Error>
[src]

Typecheck expr. If successful the type of the expression will be returned and all identifiers in expr will be filled with the inferred type

pub fn typecheck_expr_expected(
    &mut self,
    expr: &mut SpannedExpr<Symbol>,
    expected_type: Option<&ArcType>
) -> Result<ArcType, Error>
[src]

Trait Implementations

impl<'a> TypeContext<Symbol, ArcType<Symbol>> for Typecheck<'a>[src]

fn tuple<S, I>(&mut self, symbols: &mut S, elems: I) -> T where
    I: IntoIterator<Item = T>,
    S: IdentEnv<Ident = Id> + ?Sized
[src]

fn tuple_<S, I>(&mut self, symbols: &mut S, elems: I) -> Type<Id, T> where
    I: IntoIterator<Item = T>,
    S: IdentEnv<Ident = Id> + ?Sized
[src]

fn function<I>(&mut self, args: I, ret: T) -> T where
    I: IntoIterator<Item = T>,
    T: Clone,
    <I as IntoIterator>::IntoIter: DoubleEndedIterator,
    <<I as IntoIterator>::IntoIter as Iterator>::Item == T, 
[src]

fn function_implicit<I>(&mut self, args: I, ret: T) -> T where
    I: IntoIterator<Item = T>,
    <I as IntoIterator>::IntoIter: DoubleEndedIterator,
    <<I as IntoIterator>::IntoIter as Iterator>::Item == T, 
[src]

fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T where
    I: IntoIterator<Item = T>,
    <I as IntoIterator>::IntoIter: DoubleEndedIterator,
    <<I as IntoIterator>::IntoIter as Iterator>::Item == T, 
[src]

Auto Trait Implementations

impl<'a> !Send for Typecheck<'a>

impl<'a> !Sync for Typecheck<'a>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]