mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +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 {
|
match range {
|
||||||
NumericBound::None => {
|
NumericBound::None => {
|
||||||
// no additional constraints, just a Num *
|
// no additional constraints, just a Num *
|
||||||
|
num_num(Variable(num_var))
|
||||||
}
|
}
|
||||||
NumericBound::FloatExact(width) => {
|
NumericBound::FloatExact(width) => {
|
||||||
let actual_type = constraints.push_variable(float_width_to_variable(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);
|
constraints.equal_types(type_index, expected_index, category, region);
|
||||||
|
|
||||||
num_constraints.extend([because_suffix]);
|
num_constraints.extend([because_suffix]);
|
||||||
|
|
||||||
|
Variable(num_var)
|
||||||
}
|
}
|
||||||
NumericBound::IntExact(width) => {
|
NumericBound::IntExact(width) => {
|
||||||
let actual_type = constraints.push_variable(int_lit_width_to_variable(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);
|
constraints.equal_types(type_index, expected_index, category, region);
|
||||||
|
|
||||||
num_constraints.extend([because_suffix]);
|
num_constraints.extend([because_suffix]);
|
||||||
|
|
||||||
|
Variable(num_var)
|
||||||
}
|
}
|
||||||
NumericBound::Range(range) => {
|
NumericBound::Range(range) => {
|
||||||
let precision_type = constraints.push_variable(precision_var);
|
let precision_type = constraints.push_variable(precision_var);
|
||||||
|
@ -61,11 +66,11 @@ pub(crate) fn add_numeric_bound_constr(
|
||||||
let constr = constraints.equal_types(precision_type, expected_index, category, region);
|
let constr = constraints.equal_types(precision_type, expected_index, category, region);
|
||||||
|
|
||||||
num_constraints.extend([constr]);
|
num_constraints.extend([constr]);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
num_num(Variable(num_var))
|
num_num(Variable(num_var))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub(crate) fn int_literal(
|
pub(crate) fn int_literal(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue