suicmez/error_test/parser/bracket_errors.sui
2025-12-15 21:31:29 +05:30

47 lines
No EOL
801 B
Text

# Bracket and parenthesis mismatch errors
# Missing closing parenthesis in function call
fn test() -> int
let f = lambda(x) x
f(5
42
# Missing closing bracket in array access
fn test() -> int
let arr = [1, 2, 3]
arr[0
42
# Missing closing brace in struct literal
fn test() -> int
struct Point
x: int
y: int
end
let p = Point { x: 5, y: 10
p.x
# Missing closing parenthesis in tuple
fn test() -> int
let t = (1, 2, 3
42
# Missing closing angle bracket in generic
fn test() -> int
let v = Vec<int
42
# Extra closing parenthesis
fn test() -> int
let x = (5))
x
# Mismatched brackets
fn test() -> int
let x = [1, 2, 3}
x[0]
# Missing opening parenthesis in expression
fn test() -> int
let x = 5 + 3)
x