mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Update tests to check eq unbound float is resolved to dec
This commit is contained in:
parent
ed7d4f8f63
commit
3605008fce
3 changed files with 22 additions and 5 deletions
|
@ -8414,4 +8414,21 @@ mod solve_expr {
|
|||
"[Ok a]* -> a",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn resolve_eq_for_float_forces_dec() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
n : Num *
|
||||
|
||||
main = n == 1.
|
||||
# ^
|
||||
"#
|
||||
),
|
||||
@"n : Dec"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1588,7 +1588,7 @@ fn float_type(
|
|||
num_binary64,
|
||||
AliasVariables::default(),
|
||||
Variable::EMPTY_TAG_UNION,
|
||||
AliasKind::Structural,
|
||||
AliasKind::Opaque,
|
||||
)
|
||||
});
|
||||
}
|
||||
|
|
|
@ -12594,7 +12594,7 @@ I recommend using camelCase. It's the standard style in Roc code!
|
|||
|
||||
n : Num *
|
||||
|
||||
main = n == 1.
|
||||
main = n == 1f64
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
|
@ -12602,12 +12602,12 @@ I recommend using camelCase. It's the standard style in Roc code!
|
|||
|
||||
This expression has a type that does not implement the abilities it's expected to:
|
||||
|
||||
5│ main = n == 1.
|
||||
^^
|
||||
5│ main = n == 1f64
|
||||
^^^^
|
||||
|
||||
I can't generate an implementation of the `Eq` ability for
|
||||
|
||||
FloatingPoint *
|
||||
FloatingPoint ?
|
||||
|
||||
Note: I can't derive `Bool.isEq` for floating-point types. That's
|
||||
because Roc's floating-point numbers cannot be compared for total
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue