> On 22 Sep 2015, at 17:23, [email protected] wrote:
>
> Hi Marcus,
>
> I am finally playing with Reflectivity. In the first place, thanks a lot for
> this contribution!
>
> I am wondering what is the ‘correct’ way to ‘remove’ a MetaLink. Is it enough
> to call #uninstall on the MetaLink or should I also recompile the
> class/method where the link is installed?
>
> I spotted a problem with the control #after. If you try to pass #arguments to
> the meta, an error is returned. To reproduce: http://ws.stfx.eu/ONC4K9KQRTNQ
>
> Is this behavior somewhat desired, or is a bug?
>
Hello, I fixed it:
https://pharo.fogbugz.com/f/cases/16629/fix-after-on-method-with-arguments
<https://pharo.fogbugz.com/f/cases/16629/fix-after-on-method-with-arguments>
You example is now working, I added it as this test:
testReifyMethodArgsAfter
| methodNode link instance|
methodNode := (ReflectivityExamples>>#exampleWithArg:) ast.
link := MetaLink new
metaObject: self;
selector: #tagExec:;
control: #after;
arguments: #(arguments).
methodNode link: link.
self assert: methodNode hasMetalink.
self assert: (ReflectivityExamples>>#exampleWithArg:) class =
ReflectiveMethod.
self assert: (tag isNil).
instance := ReflectivityExamples new .
self assert: ((instance exampleWithArg: 3) = 5).
self assert: (tag = #(3)).
link uninstall.
I will integrate this fix and then write more tests (e.g. I think there are
still problems with an #after on a method that defines temps,
but it will be easy to fix).
Marcus