MetaLink after on a message with argument

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MetaLink after on a message with argument

Peter Uhnak
Hi,

I'm trying to install an #after metalink to a MessageNode that has an argument, however it fails because the bytecode is missing the argument (I think).
Note that #before control worked fine, so I am not sure whether this is a bug, not yet supported, or am I doing something wrong.

code (tested in P6.1):

~~~~~~~~~~~~~~~~~
Something compile: 'add: aNumber
^ 1 + aNumber'.

after := MetaLink new
metaObject: [ self logCr: 'after' ];
selector: #value;
control: #after.
"
after uninstall.
"

ast := (Something>>#add:) ast.
node := ast sendNodes first.
node link: after.

Something new add: 3.
~~~~~~~~~~~~~~~~~~~

error:

image.png

Thanks!

Peter
Reply | Threaded
Open this post in threaded view
|

Re: MetaLink after on a message with argument

Marcus Denker-4
Hi,

This is already fixed in Pharo7… if needed I can have a look to see what exactly to backport.

        Marcus

> On 4 Sep 2018, at 13:12, Peter Uhnak <[hidden email]> wrote:
>
> Hi,
>
> I'm trying to install an #after metalink to a MessageNode that has an argument, however it fails because the bytecode is missing the argument (I think).
> Note that #before control worked fine, so I am not sure whether this is a bug, not yet supported, or am I doing something wrong.
>
> code (tested in P6.1):
>
> ~~~~~~~~~~~~~~~~~
> Something compile: 'add: aNumber
> ^ 1 + aNumber'.
>
> after := MetaLink new
> metaObject: [ self logCr: 'after' ];
> selector: #value;
> control: #after.
> "
> after uninstall.
> "
>
> ast := (Something>>#add:) ast.
> node := ast sendNodes first.
> node link: after.
>
> Something new add: 3.
> ~~~~~~~~~~~~~~~~~~~
>
> error:
>
> <image.png>
>
> Thanks!
>
> Peter