mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 05:34:11 +03:00
feat(Expr2): constrain empty record
This commit is contained in:
parent
47f1bad862
commit
23f8eb62a8
@ -18,11 +18,17 @@ pub enum Constraint {
|
||||
// And(Vec<Constraint>),
|
||||
}
|
||||
|
||||
pub fn constrain_expr(env: &mut Env, expr: &Expr2, expected: Expected<Type2>) -> Constraint {
|
||||
pub fn constrain_expr(
|
||||
env: &mut Env,
|
||||
expr: &Expr2,
|
||||
expected: Expected<Type2>,
|
||||
region: Region,
|
||||
) -> Constraint {
|
||||
use Constraint::*;
|
||||
|
||||
match expr {
|
||||
Expr2::Str(_) => Eq(str_type(env.pool), expected, Category::Str, Region::zero()),
|
||||
Expr2::EmptyRecord => Eq(Type2::EmptyRec, expected, Category::Record, region),
|
||||
Expr2::Str(_) => Eq(str_type(env.pool), expected, Category::Str, region),
|
||||
_ => todo!("implement constaints for {:?}", expr),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user