---
source: compiler-core/src/parse/tests.rs
expression: "\nfn main() {\n    case somelist {\n        [..rest, last] -> 1\n        _ -> 2\n    }\n}\n"
---
----- SOURCE CODE

fn main() {
    case somelist {
        [..rest, last] -> 1
        _ -> 2
    }
}


----- ERROR
error: Syntax error
  ┌─ /src/parse/error.gleam:4:10
  │
4 │         [..rest, last] -> 1
  │          ^^^^^^ I wasn't expecting elements after this

Lists are immutable and singly-linked, so to match on the end
of a list would require the whole list to be traversed. This
would be slow, so there is no built-in syntax for it. Pattern
match on the start of the list instead.
