-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add interpreter config and strict typecheck mode * Add tests * Make it typechecker-only, and run it twice * Add a test for imports * Test the cli also * Fix benches, add a comment * Remove unused config module
- Loading branch information
Showing
19 changed files
with
167 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# capture = 'stderr' | ||
# command = ['typecheck', '--strict-typechecking'] | ||
1 + "foo" |
3 changes: 3 additions & 0 deletions
3
cli/tests/snapshot/inputs/errors/typedcheck_strict_mode_is_strict.ncl
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,3 @@ | ||
# capture = 'stderr' | ||
# command = ['typecheck', '--strict-typechecking'] | ||
let x = (1 + 1) in (x + 1 : Number) |
13 changes: 13 additions & 0 deletions
13
cli/tests/snapshot/snapshots/snapshot__typecheck_stderr_typecheck_strict_mode.ncl.snap
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,13 @@ | ||
--- | ||
source: cli/tests/snapshot/main.rs | ||
expression: err | ||
--- | ||
error: incompatible types | ||
┌─ [INPUTS_PATH]/errors/typecheck_strict_mode.ncl:3:5 | ||
│ | ||
3 │ 1 + "foo" | ||
│ ^^^^^ this expression | ||
│ | ||
= Expected an expression of type `Number` | ||
= Found an expression of type `String` | ||
= These types are not compatible |
13 changes: 13 additions & 0 deletions
13
...s/snapshot/snapshots/snapshot__typecheck_stderr_typedcheck_strict_mode_is_strict.ncl.snap
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,13 @@ | ||
--- | ||
source: cli/tests/snapshot/main.rs | ||
expression: err | ||
--- | ||
error: incompatible types | ||
┌─ [INPUTS_PATH]/errors/typedcheck_strict_mode_is_strict.ncl:3:21 | ||
│ | ||
3 │ let x = (1 + 1) in (x + 1 : Number) | ||
│ ^ this expression | ||
│ | ||
= Expected an expression of type `Number` | ||
= Found an expression of type `Dyn` | ||
= These types are not compatible |
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
4 changes: 4 additions & 0 deletions
4
core/tests/integration/inputs/lib/import_typecheck_strict.ncl
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 @@ | ||
# test.type = 'skip' | ||
|
||
# This is an auxiliary file used by typechecking tests | ||
1 + "foo" |
3 changes: 3 additions & 0 deletions
3
core/tests/integration/inputs/typecheck/shallow_type_inference_strict_mode.ncl
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,3 @@ | ||
# test.type = 'pass' | ||
# eval = 'typecheck_strict' | ||
let x = (1 + 1) in (x + 1 : Number) |
Oops, something went wrong.