# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #114230]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=114230 >


<masak> oh, but hm.
<masak> r: class C { has &!x; method f { say defined &!x; &!x //= {
'ook!' }; say defined &!x; &!x() } }; C.new.f
<p6eval> rakudo 5b56cf: OUTPUT«False␤True␤Null PMC access in
get_pmc_keyed_str() [...]
* masak submits rakudobug
<masak> r: sub foo(&x?) { &x //= { say "OH HAI" }; &x() }; foo
<p6eval> rakudo 5b56cf: OUTPUT«invoke() not implemented in class
'Callable' [...]
<jnthn> ah, no private attr needed.
<masak> yeah, but only the private attr gives a Null PMC access so far.
<jnthn> r: sub foo(&x?) { say defined &x; say
nqp::p6box_i(nqp::defined(&x)) }; foo
<p6eval> rakudo 5b56cf: OUTPUT«False␤1␤»
<jnthn> Well. That goes some way to explaining things.
<masak> r: class C { has &!x; method f { &!x() } }; C.new.f
<p6eval> rakudo 5b56cf: OUTPUT«No such method 'Any' for invocant of
type 'Parcel' [...]
<jnthn> Ohhhh...
<jnthn> It sees an invocation of a type object and thinks "oh, it's a coercin"
<jnthn> Since Any(...) is how you coerce.

Reply via email to