Support guards on lists with rest

This commit is contained in:
JRI98 2024-04-30 13:08:57 +01:00
parent db97e3ed22
commit eebd4b21c3
No known key found for this signature in database
GPG key ID: F83B29916FF13F24
4 changed files with 189 additions and 1 deletions

View file

@ -3500,3 +3500,37 @@ fn issue_6174() {
"
)
}
#[mono_test]
fn issue_6606_1() {
indoc!(
r"
foo = \_ -> 0
f =
when [] is
[.. as rest] if Bool.false -> foo rest
[] -> 1
_ -> 2
f
"
)
}
#[mono_test]
fn issue_6606_2() {
indoc!(
r"
foo = \_ -> 0
f =
when [] is
[[.. as rest]] if Bool.false -> foo rest
[[_]] -> 1
_ -> 2
f
"
)
}