2022-11-05 14:04:08 +01:00
|
|
|
## Tests forward declarations
|
|
|
|
import std;
|
|
|
|
|
|
|
|
|
|
|
|
fn foo: int;
|
|
|
|
|
|
|
|
|
2022-12-04 16:54:18 +01:00
|
|
|
print(foo() == 42);
|
2022-11-05 14:04:08 +01:00
|
|
|
|
|
|
|
|
2022-11-05 14:27:57 +01:00
|
|
|
fn foo: int {return 42;} # Commenting this line will cause an error
|
2022-11-05 14:04:08 +01:00
|
|
|
|
2023-01-24 12:08:29 +01:00
|
|
|
# Note: The forward declaration and its corresponding implementation
|
|
|
|
# must have the same visibility!
|