literal patterns should have type Int a or Float a

This commit is contained in:
Folkert 2021-01-04 23:35:29 +01:00
parent 664a232cb1
commit b80865778e

View file

@ -158,7 +158,7 @@ pub fn constrain_pattern(
state.constraints.push(Constraint::Pattern( state.constraints.push(Constraint::Pattern(
region, region,
PatternCategory::Int, PatternCategory::Int,
builtins::num_integer(Type::Variable(*precision_var)), builtins::num_int(Type::Variable(*precision_var)),
expected, expected,
)); ));
} }
@ -167,7 +167,7 @@ pub fn constrain_pattern(
state.constraints.push(Constraint::Pattern( state.constraints.push(Constraint::Pattern(
region, region,
PatternCategory::Float, PatternCategory::Float,
builtins::num_floatingpoint(Type::Variable(*precision_var)), builtins::num_float(Type::Variable(*precision_var)),
expected, expected,
)); ));
} }