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
Hi all,
any chance to fix this until 5.3? Could anyone review the attached changeset? It only patches three methods :)
Best,
Christoph
________________________________ Von: Thiede, Christoph Gesendet: Samstag, 14. September 2019 00:47:41 An: The general-purpose Squeak developers list Betreff: UndeclaredVariable correction raises Error in Parser
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
Hi all,
nine months later here is another friendly bump of this tiny patch. It would be really great if someone could spend some minutes on reviewing and merging it! :-)
Best, Christoph
-- Sent from: http://forum.world.st/Squeak-Dev-f45488.html
squeak-dev@lists.squeakfoundation.org