Hi,
We can put meta links on AST Nodes. But with Variables being represented by Objects in Pharo,
it is easy to allow those to be annotated, too.
With the changes from
it is now possible to put #before links on class variables:
testBeforeClassVariable
| classVar link |
classVar := ReflectivityExamples classVariableNamed: #ClassVar.
link := MetaLink new
metaObject: self;
selector: #tagExec.
classVar link: link.
self assert: classVar hasMetalinkBefore.
self assert: (ReflectivityExamples >> #exampleClassVarRead) class = ReflectiveMethod.
self assert: tag isNil.
self assert: ReflectivityExamples new exampleClassVarRead isNil.
self assert: tag = 'yes'.
self assert: (ReflectivityExamples >> #exampleClassVarRead) class = CompiledMethod.
self deny: (ReflectivityExamples >> #exampleClassVarRead) isQuick.
link uninstall.
ReflectivityExamples recompile: #exampleClassVarRead
TODO: #after, #instead, then reifications (e.g. value), then tests for Globals, then the same for
instance vars (slots) and temps… step by step.
Marcus