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

50 lines
765 B
Text

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