mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
feat: add inner var to IntLiteral and FloatLiteral
This commit is contained in:
parent
d62471c73a
commit
127c4e1bcc
12 changed files with 92 additions and 74 deletions
|
@ -57,8 +57,8 @@ fn headers_from_annotation_help(
|
|||
| MalformedPattern(_, _)
|
||||
| UnsupportedPattern(_)
|
||||
| NumLiteral(_, _)
|
||||
| IntLiteral(_)
|
||||
| FloatLiteral(_)
|
||||
| IntLiteral(_, _)
|
||||
| FloatLiteral(_, _)
|
||||
| StrLiteral(_) => true,
|
||||
|
||||
RecordDestructure { destructs, .. } => match annotation.value.shallow_dealias() {
|
||||
|
@ -154,20 +154,20 @@ pub fn constrain_pattern(
|
|||
));
|
||||
}
|
||||
|
||||
IntLiteral(_) => {
|
||||
IntLiteral(var, _) => {
|
||||
state.constraints.push(Constraint::Pattern(
|
||||
region,
|
||||
PatternCategory::Int,
|
||||
builtins::num_int(),
|
||||
builtins::num_int(Type::Variable(*var)),
|
||||
expected,
|
||||
));
|
||||
}
|
||||
|
||||
FloatLiteral(_) => {
|
||||
FloatLiteral(var, _) => {
|
||||
state.constraints.push(Constraint::Pattern(
|
||||
region,
|
||||
PatternCategory::Float,
|
||||
builtins::num_float(),
|
||||
builtins::num_float(Type::Variable(*var)),
|
||||
expected,
|
||||
));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue