---
source: compiler-core/src/parse/tests.rs
expression: "\nconst wibble = [2, 3]\nconst wobble = [..wibble, 4, 5]\n"
---
----- SOURCE CODE

const wibble = [2, 3]
const wobble = [..wibble, 4, 5]


----- ERROR
error: Syntax error
  ┌─ /src/parse/error.gleam:3:17
  │
3 │ const wobble = [..wibble, 4, 5]
  │                 ^^^^^^^^ I wasn't expecting elements after this

Lists are immutable and singly-linked, so to append items to them
all the elements of a list would need to be copied into a new list.
This would be slow, so there is no built-in syntax for it.

Hint: Prepend items to the list and then reverse it once you are done.
