mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Allow rigid able to unify with flex able when rigid bounds are a superset
This commit is contained in:
parent
0a96a93a67
commit
3bd10698cf
2 changed files with 27 additions and 5 deletions
|
@ -8133,4 +8133,22 @@ mod solve_expr {
|
|||
print_only_under_alias: true
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rigid_able_bounds_are_superset_of_flex_bounds_admitted() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
f : x -> x | x has Hash
|
||||
g : x -> x | x has Decoding & Encoding
|
||||
|
||||
main : x -> x | x has Hash & Decoding & Encoding
|
||||
main = \x -> x |> f |> g
|
||||
"#
|
||||
),
|
||||
"x -> x | x has Hash & Encoding & Decoding",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue