Cuis-Smalltalk-Dev
Cuis-Smalltalk-Dev copied to clipboard
Cannot invoke `Do it` on an object inspector with an expression containing undefined variables
Describe the bug
Invoking Do it
in an object inspector with a selection containing undefined variables fails.
To Reproduce
Follow these steps for all scenarios:
- Inspect
Object new
. - In the object inspector, evaluate
a _ self. a printString.
. - The
Unknown variable
dialog shows up.
1) Block-Local/Method-Local temporary scenario
- Select
block-local temp
/method-local temp
- Notice that
Do it
failed, and the source code got messed up:
a Nothing more expected ->_ se| a |
lf. a printString.
2) Instance variable scenario
- Select
instance
- Notice that the debugger is opened because of
Error: a is already defined in a subclass of Object
- Change the script so that the undefined variable has an unused name (e.g.
aaa _ self. aaa printString.
) - Notice that the system actually tried to define that instance variable, but it did not because in this case,
Object cannot be changed
.
Expected behavior I was expecting the evaluation panel in the debugger to behave more like a workspace than a debugger (e.g. to avoid defining instance variables if I am doing experiments with a script).
Screenshots
Block-Local/Method-Local temporary scenario:
https://user-images.githubusercontent.com/1807185/147976949-ac5dc782-836a-4827-b4ca-57e4228cab06.mp4
Instance variable scenario:
https://user-images.githubusercontent.com/1807185/147976983-d8218cd3-43bd-40ff-8f15-e17de8d01568.mp4
Additional context N/A
please, always post your question [email protected] . It has more chances to be seen and answered !
please, always post your question [email protected] . It has more chances to be seen and answered !
Yup! I was writing the email as this comment came in. Thanks for the reminder @nmingotti 🎉