Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VAR_INPUT and VAR_IN_OUT assignment error #604

Closed
rarris opened this issue Oct 14, 2022 · 0 comments · Fixed by #606
Closed

VAR_INPUT and VAR_IN_OUT assignment error #604

rarris opened this issue Oct 14, 2022 · 0 comments · Fixed by #606
Assignees
Labels
bug Something isn't working

Comments

@rarris
Copy link
Contributor

rarris commented Oct 14, 2022

error for variables assignment from VAR_INPUT and VAR_IN_OUT in parameter list
this occurs only if the variables declaration are in the same program
if the vars are in a external function or program declared, there is no error

example:

FUNCTION foo : DINT
VAR_INPUT
input1 : DINT;
END_VAR
VAR_IN_OUT
inout1 : DINT;
END_VAR
VAR_OUTPUT
output1 : DINT;
output2 : DINT;
END_VAR
VAR
var1, var2, var3 : DINT;
END_VAR
foo(input1 := var1, output1 => var2, inout1 := var3);
END_FUNCTION

Could not resolve reference to input1
Could not resolve reference to inout1

Test: https://github.com/PLC-lang/rusty/blob/master/src/codegen/tests/parameters_tests.rs#L7
this test is not the perfect example, the input & in_out vars should be in the same program for 100% reproducibility

@rarris rarris added the bug Something isn't working label Oct 14, 2022
@99NIMI 99NIMI self-assigned this Oct 18, 2022
99NIMI added a commit to 99NIMI/rusty that referenced this issue Oct 18, 2022
@99NIMI 99NIMI linked a pull request Oct 18, 2022 that will close this issue
99NIMI added a commit that referenced this issue Oct 19, 2022
mhasel added a commit that referenced this issue Nov 3, 2022
…osure for is_call.

regression from #604. added test to show correct behaviour
ghaith added a commit that referenced this issue Nov 14, 2022
…h 81 (#568)

* added tests to confirm string truncation bug

* added tests to confirm string truncation bug

* changed generic function annotation to fix generic string functions with length>80.

* fixed an issue that was introduced after the previous chang,e concerning generic type resolution and buils

* improved string test names

* fixed issues with variadic strings, added tests

* Add effective type info to string data types in indexer. Add test for string parameters that are shorter than they were declared as

* Fixes implementation error in a test. Renames another test that still had the name 'placeholder'.

* Fixes implementation error in a test. Renames another test that still had the name 'placeholder'.
Removes overly convoluted test.

updates generic resolver tests. changes string type annotation for literals. adds requested comments to previous changes.

* adds missing compile_module parameters (optimization + debug) to fix tests

* changes visitor context for call statements to be called once in a closure for is_call.

regression from #604. added test to show correct behaviour

* adds fix and test from #635

the changes from 554 also fix the issue from 635

Co-authored-by: Ghaith Hachem <ghaith.hachem@gmail.com>
@ghaith ghaith moved this to Done in Next Jan 9, 2023
@ghaith ghaith added this to Next Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants