-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9f9dfa
commit 3a8615a
Showing
2 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import "./imported.jou" | ||
import "stdlib/io.jou" | ||
|
||
def main() -> int: | ||
printf("%d", add(114, 514)) | ||
|
||
return 0 | ||
import "./imported/imported.jou" | ||
import "stdlib/io.jou" | ||
|
||
def main() -> int: # Output: compiler error in file "tests/other_errors/imported/imported.jou": imported file should not have `main` function | ||
printf("%d", add(114, 514)) | ||
|
||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file is meant to be imported, not ran directly. | ||
|
||
import "stdlib/io.jou" | ||
|
||
def add(a: int, b: int) -> int: | ||
return a + b | ||
|
||
def main() -> int: | ||
printf("%d", add(1, 2)) | ||
return 0 |