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

Null PMC access when calling a method on the return value of .^add_method in Rakudo #1521

Closed
p6rt opened this issue Feb 18, 2010 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Feb 18, 2010

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

Searchable as RT72916$

@p6rt
Copy link
Author

p6rt commented Feb 18, 2010

From @masak

<diakopter> rakudo​: Rat.^add_method('lol', method ($what) { say
"lol$what" }).lol('cat')
<p6eval> rakudo 5d43a3​: OUTPUT«Null PMC access in find_method('lol')␤ [...]
* masak submits rakudobug
<jnthn> fwiw, that's not supposed to work. :-)
<jnthn> (shouldn't npmca, though)
<masak> bla bla bla Null PMC access bla bla... yes
<masak> rakudo​: Rat.^add_method('x', method () {}).x
<p6eval> rakudo 5d43a3​: OUTPUT«Null PMC access in find_method('x') [...]
<jnthn> masak​: It's just that it's a method written in PIR with no .return
<masak> :)
* masak reads that as "It's just that it's a [black box]"
<jnthn> We either need (a) a blanket solution or (b) to go and
find/tweak each method/sub that does that
<jnthn> Or to write less in PIR :-)
<jnthn> No, it's quite hackable on. :-)
<masak> jnthn​: hey, I don't tell you the specifics of bug submitting! :P
<jnthn> masak​: :-P

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

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

@p6rt
Copy link
Author

p6rt commented Sep 13, 2011

From @bbkr

NOM​: Still broken.

bbkr​:nom bbkr$ ./perl6 -e 'Rat.^add_method('lol', method ($what) { say
"lol$what" }).lol("cat")'
Could not find sub &lol

To notice​: Somehow it lost Rat context, I mean it does not print
something like "Method 'lol' not found for invocant of class 'Rat'".

@p6rt
Copy link
Author

p6rt commented Oct 5, 2011

From @coke

On Tue Sep 13 14​:39​:36 2011, bbkr wrote​:

NOM​: Still broken.

bbkr​:nom bbkr$ ./perl6 -e 'Rat.^add_method('lol', method ($what) { say
"lol$what" }).lol("cat")'
Could not find sub &lol

To notice​: Somehow it lost Rat context, I mean it does not print
something like "Method 'lol' not found for invocant of class 'Rat'".

now reports​:

Method 'lol' not found for invocant of class 'Method'

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Apr 5, 2012

From @jnthn

On Tue Oct 04 18​:05​:24 2011, coke wrote​:

On Tue Sep 13 14​:39​:36 2011, bbkr wrote​:

NOM​: Still broken.

bbkr​:nom bbkr$ ./perl6 -e 'Rat.^add_method('lol', method ($what) { say
"lol$what" }).lol("cat")'
Could not find sub &lol

To notice​: Somehow it lost Rat context, I mean it does not print
something like "Method 'lol' not found for invocant of class 'Rat'".

now reports​:

Method 'lol' not found for invocant of class 'Method'

The thing about "sub" in the previous post is due to a shell quoting
fail. The latest is fine - it's not spec'd exactly what is returned, but
the Null PMC access is gone and a Method instance is a true value, and a
sensible enough thing to return. So, tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Jun 2, 2012

From @diakopter

On Thu Apr 05 07​:17​:16 2012, jnthn@​jnthn.net wrote​:

On Tue Oct 04 18​:05​:24 2011, coke wrote​:

On Tue Sep 13 14​:39​:36 2011, bbkr wrote​:

NOM​: Still broken.

bbkr​:nom bbkr$ ./perl6 -e 'Rat.^add_method('lol', method ($what) {
say
"lol$what" }).lol("cat")'
Could not find sub &lol

To notice​: Somehow it lost Rat context, I mean it does not print
something like "Method 'lol' not found for invocant of class
'Rat'".

now reports​:

Method 'lol' not found for invocant of class 'Method'

The thing about "sub" in the previous post is due to a shell quoting
fail. The latest is fine - it's not spec'd exactly what is returned,
but
the Null PMC access is gone and a Method instance is a true value, and
a
sensible enough thing to return. So, tagging testneeded.

/jnthn

19​:58 <+dalek> roast​: 369d517 | diakopter++ | S12-class/basic.t​:
19​:58 <+dalek> roast​: test RT #​72916
19​:58 <+dalek> roast​: review​:
Raku/roast@369d517e7a
19​:58 < diakopter> resolves ticket.

@p6rt
Copy link
Author

p6rt commented Jun 2, 2012

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

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