Skip to main content

dada_ir_sym/
check.rs

1//! Defines the type-checking and name-resolution logic. This is what creates the symbolic IR.
2#![doc = include_str!("../docs/type_checking.md")]
3
4use env::Env;
5use live_places::LivePlaces;
6use runtime::Runtime;
7
8use crate::ir::types::SymTy;
9
10pub(crate) mod blocks;
11mod debug;
12mod env;
13mod exprs;
14pub(crate) mod fields;
15pub(crate) mod functions;
16mod generics;
17pub(crate) mod inference;
18mod live_places;
19mod member_lookup;
20mod modules;
21mod places;
22pub(crate) mod predicates;
23pub(crate) mod red;
24pub(crate) mod report;
25mod resolve;
26mod runtime;
27pub(crate) mod scope;
28pub(crate) mod scope_tree;
29pub(crate) mod signature;
30mod statements;
31mod stream;
32mod subst_impls;
33pub(crate) mod subtype;
34mod temporaries;
35mod to_red;
36mod types;
37mod universe;
38
39/// Check an expression in a full environment.
40/// This is an async operation -- it may block if insufficient inference data is available.
41trait CheckTyInEnv<'db> {
42    type Output;
43
44    async fn check_in_env(&self, env: &mut Env<'db>) -> Self::Output;
45}
46
47trait CheckExprInEnv<'db> {
48    type Output;
49
50    async fn check_in_env(&self, env: &mut Env<'db>, live_after: LivePlaces) -> Self::Output;
51}
52
53impl<'db> CheckTyInEnv<'db> for SymTy<'db> {
54    type Output = SymTy<'db>;
55
56    async fn check_in_env(&self, _env: &mut Env<'db>) -> Self::Output {
57        *self
58    }
59}