Derive Eq for opaques

This commit is contained in:
Ayaz Hafiz 2022-10-18 13:41:59 -05:00
parent 40e05d5a00
commit 83813afeaf
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 89 additions and 2 deletions

View file

@ -8061,4 +8061,21 @@ mod solve_expr {
@"N#Hash.hash(3) : a, N -[[#N_hash(3)]]-> a | a has Hasher"
);
}
#[test]
fn derive_eq_for_opaque() {
infer_queries!(
indoc!(
r#"
app "test" provides [main] to "./platform"
N := U8 has [Eq]
main = Bool.isEq (@N 15) (@N 23)
# ^^^^^^^^^
"#
),
@"N#Bool.isEq(3) : N, N -[[#N_isEq(3)]]-> Bool"
);
}
}