forked from PLC-lang/rusty
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(validation): Initializers of struct fields (PLC-lang#1032)
This commit validates the initializers of struct fields
- Loading branch information
Showing
7 changed files
with
55 additions
and
1 deletion.
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
17 changes: 17 additions & 0 deletions
17
...dation__tests__variable_validation_tests__type_initializers_in_structs_are_validated.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,17 @@ | ||
--- | ||
source: src/validation/tests/variable_validation_tests.rs | ||
expression: diagnostics | ||
--- | ||
error: Could not resolve reference to xxx | ||
┌─ <internal>:7:41 | ||
│ | ||
7 │ unknown_reference : foo := (xxx := 1); | ||
│ ^^^ Could not resolve reference to xxx | ||
|
||
error: Array assignments must be surrounded with `[]` | ||
┌─ <internal>:8:62 | ||
│ | ||
8 │ invalid_array_assignment : ARRAY[0..1] OF INT := 0; | ||
│ ^ Array assignments must be surrounded with `[]` | ||
|
||
|
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