mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
clean up to_int_or_float
with the changes from the previous commit, this now works as it should
This commit is contained in:
parent
17348231fd
commit
d47d409a92
1 changed files with 2 additions and 9 deletions
|
@ -137,14 +137,8 @@ enum IntOrFloat {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn to_int_or_float(subs: &Subs, var: Variable) -> IntOrFloat {
|
fn to_int_or_float(subs: &Subs, var: Variable) -> IntOrFloat {
|
||||||
// TODO FIXME Investigate why both INT_INT and INT_INTEGER (and same with
|
|
||||||
// FLOAT_FLOAT and FLOAT_FLOATINGPOINT) are necessary here. It should
|
|
||||||
// be one or the other, but not both! The fact that both are necessary
|
|
||||||
// isn't a problem for this phase, but it suggests that either something
|
|
||||||
// is wrong with aliases or (more likely) some numeric builtins are being
|
|
||||||
// assigned the wrong types somewhere.
|
|
||||||
match subs.get_without_compacting(var).content {
|
match subs.get_without_compacting(var).content {
|
||||||
Content::Alias(Symbol::INT_INT, args, _) | Content::Alias(Symbol::INT_INTEGER, args, _) => {
|
Content::Alias(Symbol::INT_INTEGER, args, _) => {
|
||||||
debug_assert!(args.is_empty());
|
debug_assert!(args.is_empty());
|
||||||
IntOrFloat::IntType
|
IntOrFloat::IntType
|
||||||
}
|
}
|
||||||
|
@ -152,8 +146,7 @@ fn to_int_or_float(subs: &Subs, var: Variable) -> IntOrFloat {
|
||||||
// If this was still a (Num *), assume compiling it to an Int
|
// If this was still a (Num *), assume compiling it to an Int
|
||||||
IntOrFloat::IntType
|
IntOrFloat::IntType
|
||||||
}
|
}
|
||||||
Content::Alias(Symbol::FLOAT_FLOAT, args, _)
|
Content::Alias(Symbol::FLOAT_FLOATINGPOINT, args, _) => {
|
||||||
| Content::Alias(Symbol::FLOAT_FLOATINGPOINT, args, _) => {
|
|
||||||
debug_assert!(args.is_empty());
|
debug_assert!(args.is_empty());
|
||||||
IntOrFloat::FloatType
|
IntOrFloat::FloatType
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue