diff --git a/tests/other_errors/import_file_with_main.jou b/tests/other_errors/import_file_with_main.jou new file mode 100644 index 00000000..f03af8d6 --- /dev/null +++ b/tests/other_errors/import_file_with_main.jou @@ -0,0 +1,7 @@ +import "./imported.jou" +import "stdlib/io.jou" + +def main() -> int: + printf("%d", add(114, 514)) + + return 0 diff --git a/tests/other_errors/imported.jou b/tests/other_errors/imported.jou new file mode 100644 index 00000000..e695b03a --- /dev/null +++ b/tests/other_errors/imported.jou @@ -0,0 +1,9 @@ +import "stdlib/io.jou" + +def add(a: int, b: int) -> int: + return a + b + +def main() -> int: # Output: compiler error in file "tests/other_errors/imported.jou": imported file should not have `main` function + printf("%d", add(1, 2)) + + return 0