Skip Menu |
Report information
Id: 117421
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] Typing with ::SomeClass instead of SomeClass in 'has' declaration causes the wrong type object to end up in that attribute in Rakudo
Date: Sun, 31 Mar 2013 00:54:45 +0100
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 827b
<diakopter> r: class A { has ::B $.b }; class B {}; print B.new; print A.new.b.new <p6eval> rakudo ba5e04: OUTPUT«B<-905822265>No such method 'new' for invocant of type 'B'␤ in block at /tmp/TluLYMLqwz:1␤␤» <diakopter> masak: ^^ hmm <masak> that looks wrong. <masak> looks like it's retaining the stub, and not replacing it with the real B. * masak submits rakudobug <diakopter> r: class B {}; class A { has B $.b }; print B.new; print A.new.b.new <p6eval> rakudo ba5e04: OUTPUT«B<1785303324>B<1791592750>» <diakopter> r: class B {}; class A { has ::B $.b }; print B.new; print A.new.b.new <p6eval> rakudo ba5e04: OUTPUT«B<-931868390>No such method 'new' for invocant of type 'B'␤ in block at /tmp/ovh8hRY1hT:1␤␤» <masak> interesting. <masak> so it has nothing to do with forward references. only with ::
Still reproducible (2017.11,HEAD(e5b660e))

On 2013-03-30 16:55:04, masak wrote:
Show quoted text
> <diakopter> r: class A { has ::B $.b }; class B {}; print B.new; print
> A.new.b.new
> <p6eval> rakudo ba5e04: OUTPUT«B<-905822265>No such method 'new' for
> invocant of type 'B'␤ in block at /tmp/TluLYMLqwz:1␤␤»
> <diakopter> masak: ^^ hmm
> <masak> that looks wrong.
> <masak> looks like it's retaining the stub, and not replacing it with
> the real B.
> * masak submits rakudobug
> <diakopter> r: class B {}; class A { has B $.b }; print B.new; print
> A.new.b.new
> <p6eval> rakudo ba5e04: OUTPUT«B<1785303324>B<1791592750>»
> <diakopter> r: class B {}; class A { has ::B $.b }; print B.new; print
> A.new.b.new
> <p6eval> rakudo ba5e04: OUTPUT«B<-931868390>No such method 'new' for
> invocant of type 'B'␤ in block at /tmp/ovh8hRY1hT:1␤␤»
> <masak> interesting.
> <masak> so it has nothing to do with forward references. only with ::




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org