Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partially implemented typechecking for calls
- Loading branch information
1 parent
a9d4ab4
commit 2fadd5f
Showing
6 changed files
with
38 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Because the callee is not defined, we cannot infer the type of | ||
// func. This means the subsequent call cannot be meaningfully checked, | ||
// so it should not show any errors. | ||
var func = notDefined(); | ||
func(1, 2, 3); | ||
-- ERROR -- | ||
[line 4] Error at 'notDefined': The name 'notDefined' is not defined. |
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,4 @@ | ||
var x = "hello"; | ||
x(); | ||
-- ERROR -- | ||
[line 0] Error: Type 'String' is not callable. |
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,6 @@ | ||
// The typechecker should only complain about foo being undefined, and | ||
// not further complain that it isn't callable or that the parameter types | ||
// are incorrect. | ||
foo(1, 2, 3); | ||
-- ERROR -- | ||
[line 4] Error at 'foo': The name 'foo' is not defined. |
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