pub struct TypeChecker<'a> {
pub store: &'a ScopeStore,
pub diagnostics: Vec<SemanticDiagnostic>,
pub type_map: HashMap<TypeMapKey, Type>,
/* private fields */
}Expand description
Tracks inferred types and runs arity checks. Runs after scope building and validation.
Fields§
§store: &'a ScopeStore§diagnostics: Vec<SemanticDiagnostic>§type_map: HashMap<TypeMapKey, Type>Map from expression span (start, end) to inferred type (for formatter type annotations).
Implementations§
Source§impl<'a> TypeChecker<'a>
impl<'a> TypeChecker<'a>
pub fn new(store: &'a ScopeStore, root: &'a SyntaxNode) -> Self
Trait Implementations§
Source§impl Visitor for TypeChecker<'_>
impl Visitor for TypeChecker<'_>
Source§fn enter_node(&mut self, node: &SyntaxNode) -> WalkResult
fn enter_node(&mut self, node: &SyntaxNode) -> WalkResult
Called before visiting this node’s children (pre-order).
Source§fn leave_node(&mut self, node: &SyntaxNode) -> WalkResult
fn leave_node(&mut self, node: &SyntaxNode) -> WalkResult
Called after visiting this node’s children (post-order).
Source§fn visit_token(&mut self, _token: &SyntaxToken) -> ControlFlow<()>
fn visit_token(&mut self, _token: &SyntaxToken) -> ControlFlow<()>
Called for each token when
WalkOptions::visit_tokens is true.
Trivia is included only when WalkOptions::visit_trivia is true.Auto Trait Implementations§
impl<'a> Freeze for TypeChecker<'a>
impl<'a> RefUnwindSafe for TypeChecker<'a>
impl<'a> Send for TypeChecker<'a>
impl<'a> Sync for TypeChecker<'a>
impl<'a> Unpin for TypeChecker<'a>
impl<'a> UnsafeUnpin for TypeChecker<'a>
impl<'a> UnwindSafe for TypeChecker<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more