mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-23 14:35:12 +00:00
Add deriving toEncoder for opaques
This commit is contained in:
parent
83813afeaf
commit
c4f9aa6fe6
3 changed files with 82 additions and 7 deletions
|
@ -8045,6 +8045,23 @@ mod solve_expr {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn derive_to_encoder_for_opaque() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
N := U8 has [Encoding]
|
||||
|
||||
main = Encode.toEncoder (@N 15)
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
"#
|
||||
),
|
||||
@"N#Encode.toEncoder(3) : N -[[#N_toEncoder(3)]]-> Encoder fmt | fmt has EncoderFormatting"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn derive_hash_for_opaque() {
|
||||
infer_queries!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue