suicmez/error_test/parser/function_errors.sui

24 lines
407 B
Text
Raw Permalink Normal View History

2025-12-15 21:18:25 +05:30
# Function syntax errors
# Missing function name
fn -> int
42
# Missing parameter type annotation
fn add(x, y: int) -> int
x + y
# Missing comma in parameters
fn add(x: int y: int) -> int
x + y
# Missing closing parenthesis
fn add(x: int, y: int -> int
x + y
# Missing return type arrow
fn add(x: int, y: int) int
x + y
# Invalid function body (missing expression)
fn test() -> int