24 lines
407 B
Text
24 lines
407 B
Text
|
|
# 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
|