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

Class declaration from one module not visible if another module is loaded after it with a very similar class declaration in Rakudo #4827

Closed
p6rt opened this issue Dec 6, 2015 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 6, 2015

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

Searchable as RT126827$

@p6rt
Copy link
Author

p6rt commented Dec 6, 2015

From @masak

$ perl6 --version
This is rakudo version 2015.11-379-gfdec627 built on MoarVM version
2015.11-34-gc3eea17 implementing Perl v6.b.

$ cat foo.t
use B;

say X​::Y​::B;

$ cat bar.t
use B;
use C;

say X​::Y​::B;

$ cat lib/B.pm
class X​::Y​::B {}

$ cat lib/C.pm
class X​::Y​::C {}

$ perl6 foo.t
(B)

$ perl6 bar.t
Could not find symbol '&B'
  in block <unit> at bar.t​:4

Actually thrown at​:
  in block <unit> at bar.t​:4


Expected behavior​: bar.t should work, and print what foo.t prints.

I did a quick bisect of Rakudo, and
87288285f6f398ec7cba0900312ced4b580d79ed turns out to be the commit
that introduces the above bug.

@p6rt
Copy link
Author

p6rt commented Dec 6, 2015

From @masak

<nine> masak​: if 87288285f6f398ec7cba0900312ced4b580d79ed is to blame, it may just be an older precompilation issue that surfaced because we precompile everything that's too slow to run away now...
<nine> masak​: to find that out, it would help if you could test with a version before 3b943782768260d4422933f4e2e71be40429c570 with manual precompilation
<masak> how do I do manual precompilation?
<nine> masak​: perl6 --target=mbc --output Foo.moarvm Foo.pm
<masak> nine​: do I need to put the Foo.moarvm anywhere in particular for it to be picked up?
<nine> masak​: the old implementation just looked alongside the .pm6 file

...

<masak> good news! it works on the commit before, with manual precompilation \o/
<masak> so it's *not* an ancient error surfacing only now
<timotimo> good!
<masak> which means I should keep investigating 8728828...
<nine> masak​: why is that good news? Now I have to fix it ;)
<masak> nine​: hm. I may have spoken too soon.
<masak> nine​: I just went one commit back, not to before 3b943782
<masak> nine​: trying from that one.
<masak> nine​: ok, now it's conclusive. building off 3b943782^, with modules precompiled, everything works fine.
* masak adds this to the ticket

@p6rt
Copy link
Author

p6rt commented Dec 6, 2015

From @masak

<nine> masak​: I still doubt it's actually 8728828 that's to blame. Between 3b943782 and 8728828 there's a lot of refactoring, especially some changes touching the handling of global merging. Might be a good idea to bisect that (with manual precompilation in every step)
<masak> nine​: will do.

[...]

<masak> nine​: the results are in. a bisect of 3b943782^..87288285f, with precompilation at every step, turned up 87288285f as the first bad commit.

@p6rt
Copy link
Author

p6rt commented Mar 11, 2016

From @masak

On Sat Dec 05 16​:37​:23 2015, masak wrote​:

$ perl6 --version
This is rakudo version 2015.11-379-gfdec627 built on MoarVM version
2015.11-34-gc3eea17 implementing Perl v6.b.

$ cat foo.t
use B;

say X​::Y​::B;

$ cat bar.t
use B;
use C;

say X​::Y​::B;

$ cat lib/B.pm
class X​::Y​::B {}

$ cat lib/C.pm
class X​::Y​::C {}

$ perl6 foo.t
(B)

$ perl6 bar.t
Could not find symbol '&B'
in block <unit> at bar.t​:4

Actually thrown at​:
in block <unit> at bar.t​:4

I can no longer reproduce this bug, so I assume it's been fixed. Resolving the ticket.

@p6rt p6rt closed this as completed Mar 11, 2016
@p6rt
Copy link
Author

p6rt commented Mar 11, 2016

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

@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