[RB] RBClass has confusing interfaces
existingMethodsThatReferToInstanceVariable:
returns selectors
whichMethodsReferToInstanceVariable:
returns selectors
So we should introduce existingSelectorsThatReferToInstanceVariable and whichSelectorsReferToInstanceVariable
or a least make sure that existingMethodsThatReferToInstanceVariable and whichMethodsReferToInstanceVariable return methods!
I've checked this and they don't return selectors anymore.
In the new system existingMethodsThatReferToInstanceVariable: returns CompiledMethod
but whichMethodsReferToInstanceVariable: is tricky because it returns both CompiledMethods (since it uses the method from above). But it also return RBMethod for every new method that is added. This might be OK if API is polymorphic between CompiledMethod and RBMethod, but I didn't check that.
Maybe we can close this and open a new issue for this if it is needed in the first place.
Code to reproduce:
ns := RBNamespace new.
cls := ns classNamed: 'RBClass'.
cls compile: 'asdf1234 ^ tagName' classified: 'to remove'.
cls existingMethodsThatReferToInstanceVariable: #'tagName'.
cls whichMethodsReferToInstanceVariable: #'tagName'.