peon/tests/fwd.pn

14 lines
252 B
Plaintext
Raw Permalink Normal View History

2022-11-05 14:04:08 +01:00
## Tests forward declarations
import std;
fn foo: int;
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
# Note: The forward declaration and its corresponding implementation
# must have the same visibility!