mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
fix copy paste mistake
This commit is contained in:
parent
0be23e23da
commit
36c2b78c30
1 changed files with 16 additions and 24 deletions
|
@ -116,30 +116,22 @@ pub fn float_literal(
|
||||||
let reason = Reason::FloatLiteral;
|
let reason = Reason::FloatLiteral;
|
||||||
|
|
||||||
let mut constrs = Vec::with_capacity(3);
|
let mut constrs = Vec::with_capacity(3);
|
||||||
let num_type = {
|
let num_type = add_numeric_bound_constr(
|
||||||
let constrs: &mut Vec<Constraint> = &mut constrs;
|
&mut constrs,
|
||||||
let num_type = Variable(num_var);
|
Variable(num_var),
|
||||||
let category = Category::Float;
|
bound,
|
||||||
let range = bound.bounded_range();
|
|
||||||
|
|
||||||
let total_num_type = num_type;
|
|
||||||
|
|
||||||
match range.len() {
|
|
||||||
0 => total_num_type,
|
|
||||||
1 => {
|
|
||||||
let actual_type = Variable(range[0]);
|
|
||||||
constrs.push(Eq(
|
|
||||||
total_num_type.clone(),
|
|
||||||
Expected::ForReason(Reason::NumericLiteralSuffix, actual_type, region),
|
|
||||||
category,
|
|
||||||
region,
|
region,
|
||||||
));
|
Category::Float,
|
||||||
total_num_type
|
);
|
||||||
}
|
constrs.extend(vec![
|
||||||
_ => RangedNumber(Box::new(total_num_type), range),
|
Eq(
|
||||||
}
|
num_type.clone(),
|
||||||
};
|
ForReason(reason, num_float(Type::Variable(precision_var)), region),
|
||||||
constrs.extend(vec![]);
|
Category::Float,
|
||||||
|
region,
|
||||||
|
),
|
||||||
|
Eq(num_type, expected, Category::Float, region),
|
||||||
|
]);
|
||||||
|
|
||||||
exists(vec![num_var, precision_var], And(constrs))
|
exists(vec![num_var, precision_var], And(constrs))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue