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

Owner: Nobody
Requestors: lue <rnddim [at] gmail.com>
Cc:
AdminCc:

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



Subject: When class D::E is defined before class D, having just one of them declared in 'my' scope apparently erases D::E
Download (untitled) / with headers
text/plain 1.5k
$ perl6 -e 'class D::E { method foo { "foo" } }; class D { method bar { "bar" } }; say D.bar; say D::E.foo' bar foo $ perl6 -e 'my class D::E { method foo { "foo" } }; class D { method bar { "bar" } }; say D.bar; say D::E.foo' bar Could not find symbol '&E' in block <unit> at -e:1 Actually thrown at: in block <unit> at -e:1 $ perl6 -e 'class D::E { method foo { "foo" } }; my class D { method bar { "bar" } }; say D.bar; say D::E.foo' bar Could not find symbol '&E' in block <unit> at -e:1 Actually thrown at: in block <unit> at -e:1 $ perl6 -e 'my class D::E { method foo { "foo" } }; my class D { method bar { "bar" } }; say D.bar; say D::E.foo' bar Could not find symbol '&E' in block <unit> at -e:1 Actually thrown at: in block <unit> at -e:1 But put D before D::E : $ perl6 -e 'class D { method bar { "bar" } }; class D::E { method foo { "foo" } }; say D.bar; say D::E.foo' bar foo $ perl6 -e 'my class D { method bar { "bar" } }; class D::E { method foo { "foo" } }; say D.bar; say D::E.foo' bar foo $ perl6 -e 'class D { method bar { "bar" } }; my class D::E { method foo { "foo" } }; say D.bar; say D::E.foo' bar foo $ perl6 -e 'my class D { method bar { "bar" } }; my class D::E { method foo { "foo" } }; say D.bar; say D::E.foo' bar foo As discovered by YuriPanda at http://irclog.perlgeek.de/perl6/2015-08-24#i_11109804 , what's shown above appears to be the root of the issue.
Download (untitled) / with headers
text/plain 1.9k
I think I discovered this 3 years ago. And if I recall correctly, the answer was something like DIHWIDT. Maybe a real bug, but I don't feel confident about expecting a leaf of a namespace to still exist after you redefined the root node. Consider doing this instead: perl6 -e 'class D { ... }; my class D::E { method foo { "foo" } }; class D { method bar { "bar" } }; say D.bar; say D::E.foo' bar foo On Mon Aug 24 16:36:44 2015, lue wrote: Show quoted text
> $ perl6 -e 'class D::E { method foo { "foo" } }; class D { method bar > { "bar" } }; say D.bar; say D::E.foo' > bar > foo > $ perl6 -e 'my class D::E { method foo { "foo" } }; class D { method > bar { "bar" } }; say D.bar; say D::E.foo' > bar > Could not find symbol '&E' > in block <unit> at -e:1 > > Actually thrown at: > in block <unit> at -e:1 > $ perl6 -e 'class D::E { method foo { "foo" } }; my class D { method > bar { "bar" } }; say D.bar; say D::E.foo' > bar > Could not find symbol '&E' > in block <unit> at -e:1 > > Actually thrown at: > in block <unit> at -e:1 > $ perl6 -e 'my class D::E { method foo { "foo" } }; my class D { > method bar { "bar" } }; say D.bar; say D::E.foo' > bar > Could not find symbol '&E' > in block <unit> at -e:1 > > Actually thrown at: > in block <unit> at -e:1 > > But put D before D::E : > > $ perl6 -e 'class D { method bar { "bar" } }; class D::E { method foo > { "foo" } }; say D.bar; say D::E.foo' > bar > foo > $ perl6 -e 'my class D { method bar { "bar" } }; class D::E { method > foo { "foo" } }; say D.bar; say D::E.foo' > bar > foo > $ perl6 -e 'class D { method bar { "bar" } }; my class D::E { method > foo { "foo" } }; say D.bar; say D::E.foo' > bar > foo > $ perl6 -e 'my class D { method bar { "bar" } }; my class D::E { > method foo { "foo" } }; say D.bar; say D::E.foo' > bar > foo > > As discovered by YuriPanda at http://irclog.perlgeek.de/perl6/2015-08- > 24#i_11109804 , what's shown above appears to be the root of the > issue.


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