forked from hydro-project/hydroflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hydroflow_lang): improve singleton error messages/handling (hydr…
- Loading branch information
1 parent
c468d45
commit c9b2fb8
Showing
11 changed files
with
87 additions
and
4 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,10 @@ | ||
pub fn main() { | ||
let mut df = hydroflow::hydroflow_syntax! { | ||
my_ref = source_iter(15..=25) -> null(); | ||
source_iter(10..=30) | ||
-> filter(|value| value <= #my_ref.as_reveal_ref()) | ||
-> null(); | ||
|
||
}; | ||
df.run_available(); | ||
} |
20 changes: 20 additions & 0 deletions
20
hydroflow/tests/compile-fail/surface_singleton_nostate.stderr
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,20 @@ | ||
error[E0425]: cannot find value `singleton_op_2v1` in this scope | ||
--> tests/compile-fail/surface_singleton_nostate.rs:5:16 | ||
| | ||
5 | -> filter(|value| value <= #my_ref.as_reveal_ref()) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope | ||
|
||
error[E0282]: type annotations needed | ||
--> tests/compile-fail/surface_singleton_nostate.rs:2:18 | ||
| | ||
2 | let mut df = hydroflow::hydroflow_syntax! { | ||
| __________________^ | ||
3 | | my_ref = source_iter(15..=25) -> null(); | ||
4 | | source_iter(10..=30) | ||
5 | | -> filter(|value| value <= #my_ref.as_reveal_ref()) | ||
6 | | -> null(); | ||
7 | | | ||
8 | | }; | ||
| |_____^ cannot infer type | ||
| | ||
= note: this error originates in the macro `hydroflow::hydroflow_syntax` (in Nightly builds, run with -Z macro-backtrace for more info) |
9 changes: 9 additions & 0 deletions
9
hydroflow/tests/compile-fail/surface_singleton_nostate_undefined.rs
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 @@ | ||
pub fn main() { | ||
let mut df = hydroflow::hydroflow_syntax! { | ||
my_ref = source_iter(15..=25) -> null(); | ||
source_iter(10..=30) | ||
-> filter(|value| value <= #my_ref.as_reveal_ref() && value <= #unknown.as_reveal_ref()) | ||
-> null(); | ||
}; | ||
df.run_available(); | ||
} |
5 changes: 5 additions & 0 deletions
5
hydroflow/tests/compile-fail/surface_singleton_nostate_undefined.stderr
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 @@ | ||
error: Cannot find referenced name `unknown`; name was never assigned. | ||
--> tests/compile-fail/surface_singleton_nostate_undefined.rs:5:77 | ||
| | ||
5 | -> filter(|value| value <= #my_ref.as_reveal_ref() && value <= #unknown.as_reveal_ref()) | ||
| ^^^^^^^ |
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 @@ | ||
pub fn main() { | ||
let mut df = hydroflow::hydroflow_syntax! { | ||
source_iter(10..=30) | ||
-> filter(|value| value <= #unknown.as_reveal_ref()) | ||
-> null(); | ||
|
||
}; | ||
df.run_available(); | ||
} |
5 changes: 5 additions & 0 deletions
5
hydroflow/tests/compile-fail/surface_singleton_undefined.stderr
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 @@ | ||
error: Cannot find referenced name `unknown`; name was never assigned. | ||
--> tests/compile-fail/surface_singleton_undefined.rs:4:41 | ||
| | ||
4 | -> filter(|value| value <= #unknown.as_reveal_ref()) | ||
| ^^^^^^^ |
9 changes: 9 additions & 0 deletions
9
hydroflow/tests/compile-fail/surface_singleton_undefined_nostate.rs
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 @@ | ||
pub fn main() { | ||
let mut df = hydroflow::hydroflow_syntax! { | ||
my_ref = source_iter(15..=25) -> null(); | ||
source_iter(10..=30) | ||
-> filter(|value| value <= #unknown.as_reveal_ref() && value <= #my_ref.as_reveal_ref()) | ||
-> null(); | ||
}; | ||
df.run_available(); | ||
} |
5 changes: 5 additions & 0 deletions
5
hydroflow/tests/compile-fail/surface_singleton_undefined_nostate.stderr
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 @@ | ||
error: Cannot find referenced name `unknown`; name was never assigned. | ||
--> tests/compile-fail/surface_singleton_undefined_nostate.rs:5:41 | ||
| | ||
5 | -> filter(|value| value <= #unknown.as_reveal_ref() && value <= #my_ref.as_reveal_ref()) | ||
| ^^^^^^^ |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...le-fail/surface_undefined_variable.stderr → ...ile-fail/surface_varname_undefined.stderr
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,11 +1,11 @@ | ||
error: Cannot find name `hydro_lab`; name was never assigned. | ||
--> tests/compile-fail/surface_undefined_variable.rs:5:9 | ||
--> tests/compile-fail/surface_varname_undefined.rs:5:9 | ||
| | ||
5 | hydro_lab -> for_each(std::mem::drop); | ||
| ^^^^^^^^^ | ||
|
||
error: `for_each` must have exactly 1 input(s), actually has 0. | ||
--> tests/compile-fail/surface_undefined_variable.rs:5:22 | ||
--> tests/compile-fail/surface_varname_undefined.rs:5:22 | ||
| | ||
5 | hydro_lab -> for_each(std::mem::drop); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ |
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