Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using callsame from add_method in Metamodel subclass as the last statement in add_method only works half of the time #4228

Closed
p6rt opened this issue May 8, 2015 · 7 comments

Comments

@p6rt
Copy link

p6rt commented May 8, 2015

Migrated from rt.perl.org#125135 (status was 'resolved')

Searchable as RT125135$

@p6rt
Copy link
Author

p6rt commented May 8, 2015

From @hoelzro

When invoking callsame in add_method when making a custom metaclass, callsame fails to invoke the next candidate on even-numbered invocations. Adding an explicit return in front of callsame, or a statement after it (ex. say 'hi') fixes the issue. Please consult the attached code.

I dug into the callsame code a bit, and it seems that the same dispatcher object is used between calls. This causes the dispatcher to incorrectly think that it is out of candidates on odd-numbered invocations of callsame. I don't know how the dispatcher object is initialized; I would be happy to dig into this further if someone could point me in the right direction.

@p6rt
Copy link
Author

p6rt commented May 8, 2015

From @hoelzro

TestHOW.pm

@p6rt
Copy link
Author

p6rt commented May 8, 2015

From @hoelzro

test.p6

@p6rt
Copy link
Author

p6rt commented Jan 3, 2017

From @jnthn

On Thu, 07 May 2015 20​:30​:53 -0700, rob@​hoelz.ro wrote​:

When invoking callsame in add_method when making a custom metaclass,
callsame fails to invoke the next candidate on even-numbered
invocations. Adding an explicit return in front of callsame, or a
statement after it (ex. say 'hi') fixes the issue. Please consult the
attached code.

I dug into the callsame code a bit, and it seems that the same
dispatcher object is used between calls. This causes the dispatcher
to incorrectly think that it is out of candidates on odd-numbered
invocations of callsame. I don't know how the dispatcher object is
initialized; I would be happy to dig into this further if someone
could point me in the right direction.

This works now on HEAD, and just needs a test (which I believe is already being worked on).

@p6rt
Copy link
Author

p6rt commented Jan 3, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 3, 2017

From @jnthn

On Tue, 03 Jan 2017 10​:11​:23 -0800, jnthn@​jnthn.net wrote​:

On Thu, 07 May 2015 20​:30​:53 -0700, rob@​hoelz.ro wrote​:

When invoking callsame in add_method when making a custom metaclass,
callsame fails to invoke the next candidate on even-numbered
invocations. Adding an explicit return in front of callsame, or a
statement after it (ex. say 'hi') fixes the issue. Please consult
the
attached code.

I dug into the callsame code a bit, and it seems that the same
dispatcher object is used between calls. This causes the dispatcher
to incorrectly think that it is out of candidates on odd-numbered
invocations of callsame. I don't know how the dispatcher object is
initialized; I would be happy to dig into this further if someone
could point me in the right direction.

This works now on HEAD, and just needs a test (which I believe is
already being worked on).

Tested in S12-meta/classhow.t by dogbert17++; resolving.

@p6rt
Copy link
Author

p6rt commented Jan 3, 2017

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jan 3, 2017
@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant