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

Wrapping a detached method breaks method deferral in Rakudo #2245

Open
p6rt opened this issue Nov 6, 2010 · 4 comments
Open

Wrapping a detached method breaks method deferral in Rakudo #2245

p6rt opened this issue Nov 6, 2010 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Nov 6, 2010

Migrated from rt.perl.org#78870 (status was 'open')

Searchable as RT78870$

@p6rt
Copy link
Author

p6rt commented Nov 6, 2010

From @masak

<masak> rakudo​: class A { method foo { say "A" } }; class B is A {
method foo { say "B"; nextsame } }; B.new.foo
<p6eval> rakudo 142d22​: OUTPUT«B␤A␤»
<masak> rakudo​: class A { method foo { say "A" } }; class B is A {
method foo { say "B"; nextsame } }; my &x = B.WALK(​:name<foo>)[0];
&x.wrap​: { say "wrap"; nextsame }; x(B.new)
<p6eval> rakudo 142d22​: OUTPUT«wrap␤B␤»
* masak submits rakudobug
<masak> why doesn't the last evaluation print "wrap␤B␤A␤"?

@p6rt
Copy link
Author

p6rt commented Nov 6, 2010

From @masak

masak (>)​:

<masak> rakudo​: class A { method foo { say "A" } }; class B is A {
method foo { say "B"; nextsame } }; B.new.foo
<p6eval> rakudo 142d22​: OUTPUT«B␤A␤»
<masak> rakudo​: class A { method foo { say "A" } }; class B is A {
method foo { say "B"; nextsame } }; my &x = B.WALK(​:name<foo>)[0];
&x.wrap​: { say "wrap"; nextsame }; x(B.new)
<p6eval> rakudo 142d22​: OUTPUT«wrap␤B␤»
* masak submits rakudobug
<masak> why doesn't the last evaluation print "wrap␤B␤A␤"?

<jnthn> masak​: hmm
<jnthn> masak​: I can kinda see why it's happening.
<jnthn> masak​: It feels wrong.
<masak> what feels wrong?
<jnthn> That wrapping it breaks the deferal up the MRO
<masak> jnthn​: yes -- that's the title of my bug report :)
<jnthn> masak​: To make it work, the current candidate list kinda needs to get "collected" or
something.
<jnthn> When it gets to the ponit of being fully iterated.
<jnthn> So we fall to the otuer dispatcher's idea of current candidate list.
<masak> jnthn​: ok.
<jnthn> e.g. empty = implicit pop
* masak adds all this to the ticket
<masak> conceptually, I don't see any problem.
<jnthn> No, I don't have an immediate example of a problem we'd cause or some extra fragility
it'd introduce.
<jnthn> Tend to be a little knee-jerky against implicit magic, that's all. :-)

@p6rt
Copy link
Author

p6rt commented Nov 6, 2010

@masak - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

From @diakopter

new behavior​:

12​:16 <diakopter> rakudo​: class A { method foo { say "A" } }; class B is A {
  method foo { say "B"; nextsame } }; my &x =
  B.WALK(​:name<foo>)[0]; &x.wrap​: { say "wrap"; nextsame };
  x(B.new)
12​:16 <camelia> rakudo-moar 61d231​: OUTPUT«wrap␤B␤Attempt to return outside of
  any Routine␤ in block <unit> at /tmp/tmpfile line 1␤␤»

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant