Hi all,
maybe someone has time and knowledge to fix the following bug?
Scenario:
Try to compile the following method:
foo
ba := nil.
42 ifNotNil: [:ba | ba].
Then accept it and answer the UndeclaredVariable dialog with 'declare temp variable'.
Expected behavior:
The method should be corrected to:
foo
| ba |
ba := nil.
42 ifNotNil: [: "Name already used in this method ->"ba | ba].
Actual behavior:
UndeclaredVariableNode>>#sizeCodeForStorePop: is called and raises a #shouldNotImplement.
Interpretation:
I guess the problem is in #undeclaredTemps, where the encoder does not declare ba which was shadowed by the declaration in the block. How could that be solved? My first approach would be to store all UndeclaredTempVars in #bindUndeclaredTemp: separately, but I'm quite sure this is not efficient ... How would you solve this problem the best way?
However, I attached a change set for my attempt, all tests are green.
I'm excited to hear your answers! :)
Best,
Christoph