mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-23 06:25:10 +00:00
Add support for deriving Hash for opaques
This commit is contained in:
parent
a4ed5a582d
commit
40e05d5a00
3 changed files with 213 additions and 22 deletions
|
@ -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"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue