Allow rigid able to unify with flex able when rigid bounds are a superset

This commit is contained in:
Ayaz Hafiz 2022-10-12 16:32:59 -05:00
parent 0a96a93a67
commit 3bd10698cf
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 27 additions and 5 deletions

View file

@ -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",
);
}
}