rusty
rusty copied to clipboard
Shadowing parent variables in `VAR_TEMP` blocks
should we allow shadowing parent variables with temp vars ?
FUNCTION_BLOCK fb
VAR
x: INT := 10;
END_VAR
END_FUNCTION_BLOCK
FUNCTION_BLOCK fb2 EXTENDS fb
// the following var-block will currently cause a compile error
VAR_TEMP
x: INT := 20;
END_VAR
END_FUNCTION_BLOCK
I would lean towards yes, but maybe track this in a separate issue to discuss there?
Originally posted by @volsa in https://github.com/PLC-lang/rusty/pull/1445#discussion_r2035192899
I say yes with a warning