mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Plain number literals (e.g. 5
) are now Num *
This commit is contained in:
parent
9081b7f2d1
commit
3ecbe0325c
21 changed files with 345 additions and 223 deletions
|
@ -53,6 +53,7 @@ fn headers_from_annotation_help(
|
|||
Underscore
|
||||
| Shadowed(_, _)
|
||||
| UnsupportedPattern(_)
|
||||
| NumLiteral(_, _)
|
||||
| IntLiteral(_)
|
||||
| FloatLiteral(_)
|
||||
| StrLiteral(_) => true,
|
||||
|
@ -124,10 +125,22 @@ pub fn constrain_pattern(
|
|||
},
|
||||
);
|
||||
}
|
||||
|
||||
NumLiteral(var, _) => {
|
||||
state.vars.push(*var);
|
||||
|
||||
state.constraints.push(Constraint::Pattern(
|
||||
region,
|
||||
PatternCategory::Num,
|
||||
builtins::builtin_type(Symbol::NUM_NUM, vec![Type::Variable(*var)]),
|
||||
expected,
|
||||
));
|
||||
}
|
||||
|
||||
IntLiteral(_) => {
|
||||
state.constraints.push(Constraint::Pattern(
|
||||
region,
|
||||
PatternCategory::Int,
|
||||
PatternCategory::Float,
|
||||
builtins::builtin_type(Symbol::INT_INT, vec![]),
|
||||
expected,
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue