feat: add inner var to IntLiteral and FloatLiteral

This commit is contained in:
rvcas 2020-12-29 20:52:54 -05:00
parent d62471c73a
commit 127c4e1bcc
12 changed files with 92 additions and 74 deletions

View file

@ -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,
));
}