Struct gluon_check::typecheck::Typecheck
[−]
[src]
pub struct Typecheck<'a> { /* fields omitted */ }
Struct which provides methods to typecheck expressions.
Methods
impl<'a> Typecheck<'a>
[src]
fn new(
module: String,
symbols: &'a mut Symbols,
environment: &'a PrimitiveEnv + 'a
) -> Typecheck<'a>
module: String,
symbols: &'a mut Symbols,
environment: &'a PrimitiveEnv + 'a
) -> Typecheck<'a>
Create a new typechecker which typechecks expressions in module
fn typecheck_expr(
&mut self,
expr: &mut SpannedExpr<Symbol>
) -> Result<ArcType, Error>
&mut self,
expr: &mut SpannedExpr<Symbol>
) -> Result<ArcType, Error>
Typecheck expr
. If successful the type of the expression will be returned and all
identifiers in expr
will be filled with the inferred type
fn typecheck_expr_expected(
&mut self,
expr: &mut SpannedExpr<Symbol>,
expected_type: Option<&ArcType>
) -> Result<ArcType, Error>
&mut self,
expr: &mut SpannedExpr<Symbol>,
expected_type: Option<&ArcType>
) -> Result<ArcType, Error>