mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Fix list rest bind in when branch tuple destructure
This commit is contained in:
parent
9b7eb05b87
commit
689a1ff352
3 changed files with 81 additions and 3 deletions
|
@ -3447,3 +3447,19 @@ fn inspect_derived_dict() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn issue_6196() {
|
||||
indoc!(
|
||||
r#"
|
||||
nth : List a, Nat -> Result a [OutOfBounds]
|
||||
nth = \l, i ->
|
||||
when (l, i) is
|
||||
([], _) -> Err OutOfBounds
|
||||
([e, ..], 0) -> Ok e
|
||||
([_, .. as rest], _) -> nth rest (i - 1)
|
||||
|
||||
nth ["a"] 0
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue