This commit is contained in:
ayazhafiz 2022-02-06 00:24:39 -05:00
parent 8dc92ccd97
commit c80c842a93
5 changed files with 34 additions and 4 deletions

View file

@ -35,7 +35,7 @@ pub fn add_numeric_bound_constr(
));
total_num_type
}
_ => RangedNumber(Box::new(total_num_type.clone()), range),
_ => RangedNumber(Box::new(total_num_type), range),
}
}
@ -66,7 +66,7 @@ pub fn int_literal(
Category::Int,
region,
),
Eq(num_type, expected.clone(), Category::Int, region),
Eq(num_type, expected, Category::Int, region),
]);
exists(vec![num_var], And(constrs))

View file

@ -185,7 +185,7 @@ pub fn constrain_pattern(
let num_type = builtins::add_numeric_bound_constr(
&mut state.constraints,
num_type.clone(),
num_type,
bound,
region,
Category::Num,

View file

@ -231,7 +231,7 @@ impl SolvedType {
}
}
Variable(var) => Self::from_var(solved_subs.inner(), *var),
RangedNumber(typ, _) => Self::from_type(solved_subs, &typ),
RangedNumber(typ, _) => Self::from_type(solved_subs, typ),
}
}

View file

@ -1058,6 +1058,7 @@ fn define_integer_types(subs: &mut Subs) {
);
}
#[allow(clippy::too_many_arguments)]
fn float_type(
subs: &mut Subs,