mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Revert "Try fixing a surprising constraint behavior"
This reverts commit ae2855628e
.
This commit is contained in:
parent
ae2855628e
commit
dd031855a9
1 changed files with 7 additions and 2 deletions
|
@ -30,6 +30,7 @@ pub(crate) fn add_numeric_bound_constr(
|
|||
match range {
|
||||
NumericBound::None => {
|
||||
// no additional constraints, just a Num *
|
||||
num_num(Variable(num_var))
|
||||
}
|
||||
NumericBound::FloatExact(width) => {
|
||||
let actual_type = constraints.push_variable(float_width_to_variable(width));
|
||||
|
@ -40,6 +41,8 @@ pub(crate) fn add_numeric_bound_constr(
|
|||
constraints.equal_types(type_index, expected_index, category, region);
|
||||
|
||||
num_constraints.extend([because_suffix]);
|
||||
|
||||
Variable(num_var)
|
||||
}
|
||||
NumericBound::IntExact(width) => {
|
||||
let actual_type = constraints.push_variable(int_lit_width_to_variable(width));
|
||||
|
@ -50,6 +53,8 @@ pub(crate) fn add_numeric_bound_constr(
|
|||
constraints.equal_types(type_index, expected_index, category, region);
|
||||
|
||||
num_constraints.extend([because_suffix]);
|
||||
|
||||
Variable(num_var)
|
||||
}
|
||||
NumericBound::Range(range) => {
|
||||
let precision_type = constraints.push_variable(precision_var);
|
||||
|
@ -61,10 +66,10 @@ pub(crate) fn add_numeric_bound_constr(
|
|||
let constr = constraints.equal_types(precision_type, expected_index, category, region);
|
||||
|
||||
num_constraints.extend([constr]);
|
||||
|
||||
num_num(Variable(num_var))
|
||||
}
|
||||
}
|
||||
|
||||
num_num(Variable(num_var))
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue