Plain number literals (e.g. 5) are now Num *

This commit is contained in:
Richard Feldman 2020-03-10 20:40:53 -04:00
parent 9081b7f2d1
commit 3ecbe0325c
21 changed files with 345 additions and 223 deletions

View file

@ -80,6 +80,14 @@ pub fn constrain_expr(
) -> Constraint {
match expr {
Int(var, _) => int_literal(*var, expected, region),
Num(var, _) => exists(
vec![*var],
Eq(
Type::Apply(Symbol::NUM_NUM, vec![Type::Variable(*var)]),
expected,
region,
),
),
Float(var, _) => float_literal(*var, expected, region),
EmptyRecord => constrain_empty_record(region, expected),
Expr::Record(stored_var, fields) => {