-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
report an error when failing to infer unannotated lambda
- Loading branch information
1 parent
634d892
commit 32bc746
Showing
5 changed files
with
43 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fn main() -> i32 { | ||
let clos = \(z) { z }; | ||
clos(1) | ||
} |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ global g = return 1 | |
global g2 = { | ||
let x = 3; | ||
return x | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
crates/cli/tests/snapshots/check@cant_infer_lambda.nemo.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,25 @@ | ||
--- | ||
source: crates/cli/tests/lib.rs | ||
info: | ||
program: nemo | ||
args: | ||
- check | ||
- tests/check/cant_infer_lambda.nemo | ||
env: | ||
RUST_BACKTRACE: "0" | ||
input_file: crates/cli/tests/check/cant_infer_lambda.nemo | ||
--- | ||
success: false | ||
exit_code: 1 | ||
----- stdout ----- | ||
[31m[27] Error:[0m Can't infer type of unannotated lambda | ||
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0mtests/check/cant_infer_lambda.nemo:1:13[38;5;246m][0m | ||
[38;5;246m│[0m | ||
[38;5;246m2 │[0m [38;5;249m [0m[38;5;249m [0m[38;5;249ml[0m[38;5;249me[0m[38;5;249mt[0m[38;5;249m [0m[38;5;249mc[0m[38;5;249ml[0m[38;5;249mo[0m[38;5;249ms[0m[38;5;249m [0m[38;5;249m=[0m[38;5;249m [0m[38;5;249m\[0m[38;5;249m([0mz[38;5;249m)[0m[38;5;249m [0m[38;5;249m{[0m[38;5;249m [0m[38;5;249mz[0m[38;5;249m [0m[38;5;249m}[0m[38;5;249m;[0m | ||
[38;5;240m │[0m ┬ | ||
[38;5;240m │[0m ╰── Can't infer type of unannotated lambda | ||
[38;5;246m───╯[0m | ||
|
||
|
||
----- stderr ----- | ||
Error: "Check failed with 1 errors" |
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