XO0161: list element followed by a newline instead of a comma
Newlines end statements (core 1.3), so a comma separated list (arguments, list, map, or struct literal elements, parameters) that spans lines needs a comma after every element, including the last one. Trailing commas are allowed in every list. The diagnostic carries a fix that inserts the comma. See core 1.3.
Example
fn f() -> List[Int] {
let xs = [
1,
2
]
xs
}Fix
fn f() -> List[Int] {
let xs = [
1,
2,
]
xs
}Run xo explain XO0161 for this text in a terminal, or see
section 10.6 of the specification.