Add support for deriving Hash for opaques

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

View file

@ -8044,4 +8044,21 @@ mod solve_expr {
"{} -> {}",
);
}
#[test]
fn derive_hash_for_opaque() {
infer_queries!(
indoc!(
r#"
app "test" provides [main] to "./platform"
N := U8 has [Hash]
main = \hasher, @N n -> Hash.hash hasher (@N n)
# ^^^^^^^^^
"#
),
@"N#Hash.hash(3) : a, N -[[#N_hash(3)]]-> a | a has Hasher"
);
}
}