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.
fix(validation): fix false-positive unresolved generic symbol validat…
…ion for formal parameters (PLC-lang#1066) * fix(validation): fix false-positive unresolved generic symbol validation for formal parameters * remove unreferenced snapshots
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
...sty__validation__tests__generic_validation_tests__generic_call_with_formal_parameter.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,29 @@ | ||
--- | ||
source: src/validation/tests/generic_validation_tests.rs | ||
expression: diagnostics | ||
--- | ||
error: Invalid call parameters | ||
┌─ <internal>:20:30 | ||
│ | ||
20 │ myLocalNumber := FOO(y := 0); // unresolved reference | ||
│ ^^^^^^ Invalid call parameters | ||
|
||
error: Could not resolve reference to y | ||
┌─ <internal>:20:30 | ||
│ | ||
20 │ myLocalNumber := FOO(y := 0); // unresolved reference | ||
│ ^ Could not resolve reference to y | ||
|
||
error: Invalid type nature for generic argument. __STRING_19 is no ANY_NUMBER | ||
┌─ <internal>:21:35 | ||
│ | ||
21 │ myLocalNumber := FOO(x := 'INVALID TYPE NATURE'); // invalid type nature | ||
│ ^^^^^^^^^^^^^^^^^^^^^ Invalid type nature for generic argument. __STRING_19 is no ANY_NUMBER | ||
|
||
error: Invalid assignment: cannot assign 'STRING' to 'USINT' | ||
┌─ <internal>:21:30 | ||
│ | ||
21 │ myLocalNumber := FOO(x := 'INVALID TYPE NATURE'); // invalid type nature | ||
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'STRING' to 'USINT' | ||
|
||
|