mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Support guards on lists with rest
This commit is contained in:
parent
db97e3ed22
commit
eebd4b21c3
4 changed files with 189 additions and 1 deletions
|
@ -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
|
||||
"
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue