-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the error message for trying to use a private definition from a module that hasn't been required
- Loading branch information
Showing
12 changed files
with
66 additions
and
14 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
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
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
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
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
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
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,9 @@ | ||
[93mType error[0m: | ||
[96mproject/private/bmod.sail[0m:4.4-7: | ||
4[96m |[0m foo("Cannot be called") | ||
[91m |[0m [91m^-^[0m | ||
[91m |[0m Cannot use private definition | ||
[91m |[0m | ||
[91m |[0m [96mproject/private/amod.sail[0m:3.17-20: | ||
[91m |[0m 3[96m |[0mprivate function foo(message : string) -> unit = { | ||
[91m |[0m [91m |[0m [91m^-^[0m [91mprivate definition here in A[0m |
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,9 @@ | ||
|
||
A { | ||
files private/amod.sail | ||
} | ||
|
||
B { | ||
requires A | ||
files private/bmod.sail | ||
} |
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 @@ | ||
[93mType error[0m: | ||
[96mproject/private/bmod.sail[0m:4.4-7: | ||
4[96m |[0m foo("Cannot be called") | ||
[91m |[0m [91m^-^[0m | ||
[91m |[0m Cannot use private definition | ||
[91m |[0m The module containing this definition is also not required in this context | ||
[91m |[0m | ||
[91m |[0m [96mproject/private/amod.sail[0m:3.17-20: | ||
[91m |[0m 3[96m |[0mprivate function foo(message : string) -> unit = { | ||
[91m |[0m [91m |[0m [91m^-^[0m [91mprivate definition here in A[0m |
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,8 @@ | ||
|
||
A { | ||
files private/amod.sail | ||
} | ||
|
||
B { | ||
files private/bmod.sail | ||
} |
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,5 @@ | ||
$include <string.sail> | ||
|
||
private function foo(message : string) -> unit = { | ||
print_endline(message) | ||
} |
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,5 @@ | ||
val main : unit -> unit | ||
|
||
function main() = { | ||
foo("Cannot be called") | ||
} |