mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-25 13:36:37 +00:00
parent
c48c4f3183
commit
52e15bd344
3 changed files with 37 additions and 1 deletions
|
|
@ -1343,7 +1343,7 @@ fn test_to_equality<'a>(
|
|||
}),
|
||||
)
|
||||
}
|
||||
_ => unreachable!("{:?}", (cond_layout, union)),
|
||||
_ => unreachable!("{:#?}", (cond_layout, union, test_layout, path)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7357,4 +7357,24 @@ mod solve_expr {
|
|||
"List (A U8)",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn issue_3560_nested_tag_union() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [Encode.{ toEncoder }, Json]
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
when Wrapper (Payload "err") is
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Wrapper (Payload str) -> str
|
||||
Wrapper (AlternatePayload str) -> str
|
||||
"#
|
||||
),
|
||||
&[r#"Wrapper (Payload "err") : [Wrapper [AlternatePayload Str, Payload Str]]"#,]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1884,3 +1884,19 @@ fn encode_derived_tag_two_payloads_string() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn issue_3560_nested_tag_union() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [Encode.{ toEncoder }, Json]
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
when Wrapper (Payload "err") is
|
||||
Wrapper (Payload str) -> str
|
||||
Wrapper (AlternatePayload str) -> str
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue