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

Precompiled modules and roles lead to rakudo not recognizing type name #2726

Closed
p6rt opened this issue Apr 26, 2012 · 6 comments
Closed

Precompiled modules and roles lead to rakudo not recognizing type name #2726

p6rt opened this issue Apr 26, 2012 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Apr 26, 2012

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

Searchable as RT112626$

@p6rt
Copy link
Author

p6rt commented Apr 26, 2012

From @moritz

Another bug condensed from colomon++'s ABC module​:

# file ./lib/A/Role.pm
use v6;
role A​::Role { }

# file ./lib/A/Class1.pm
use v6;
use A​::Role;
class A​::Class1 does A​::Role { }

# file ./lib/A/Class2.pm
use v6;
use A​::Role;

class A​::Classs2 does A​::Role { }

# file ./lib/A/Conflict.pm
use v6;
use A​::Class1;
use A​::Class2;

sub f(A​::Class1 $x) {}

running 'ufo && make' produces the following error​:

mkdir -p `dirname 'blib/lib/A/Role.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Role.pir lib/A/Role.pm
mkdir -p `dirname 'blib/lib/A/Class1.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Class1.pir lib/A/Class1.pm
mkdir -p `dirname 'blib/lib/A/Class2.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Class2.pir lib/A/Class2.pm
mkdir -p `dirname 'blib/lib/A/Conflict.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Conflict.pir lib/A/Conflict.pm
===SORRY!===
Invalid typename in parameter declaration at line 5, near " $x) {}\n"
make​: *** [blib/lib/A/Conflict.pir] Error 1

Note that the error goes away when removing the 'use A​::Class2;'
statement, which should be totally irrelevant.

@p6rt
Copy link
Author

p6rt commented Apr 26, 2012

From @moritz

Note that the error also goes away when using top-level namespaces, eg
'class Class1' instead of 'class A​::Class1'

@p6rt
Copy link
Author

p6rt commented Apr 26, 2012

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

@p6rt
Copy link
Author

p6rt commented Nov 15, 2012

From @jnthn

On Thu Apr 26 12​:25​:35 2012, moritz wrote​:

Another bug condensed from colomon++'s ABC module​:

# file ./lib/A/Role.pm
use v6;
role A​::Role { }

# file ./lib/A/Class1.pm
use v6;
use A​::Role;
class A​::Class1 does A​::Role { }

# file ./lib/A/Class2.pm
use v6;
use A​::Role;

class A​::Classs2 does A​::Role { }

# file ./lib/A/Conflict.pm
use v6;
use A​::Class1;
use A​::Class2;

sub f(A​::Class1 $x) {}

running 'ufo && make' produces the following error​:

mkdir -p `dirname 'blib/lib/A/Role.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Role.pir lib/A/Role.pm
mkdir -p `dirname 'blib/lib/A/Class1.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Class1.pir lib/A/Class1.pm
mkdir -p `dirname 'blib/lib/A/Class2.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Class2.pir lib/A/Class2.pm
mkdir -p `dirname 'blib/lib/A/Conflict.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Conflict.pir lib/A/Conflict.pm
===SORRY!===
Invalid typename in parameter declaration at line 5, near " $x) {}\n"
make​: *** [blib/lib/A/Conflict.pir] Error 1

Note that the error goes away when removing the 'use A​::Class2;'
statement, which should be totally irrelevant.

Fixed now​:

$ perl6 -Imodules --target=pir modules\A\Role.pm > modules\A\Role.pir

$ perl6 -Imodules --target=pir modules\A\Class1.pm > modules\A\Class1.pir

$ perl6 -Imodules --target=pir modules\A\Class2.pm > modules\A\Class2.pir

$ perl6 -Imodules -e "use A​::Conflict; say 'ok'"
ok

$ perl6 -Imodules --target=pir modules\A\Conflict.pm >
modules\A\Conflict.pir

$ perl6 -Imodules -e "use A​::Conflict; say 'ok'"
ok

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Sep 11, 2016

From @zoffixznet

Tests added in Raku/roast@ebfe979b60

@p6rt
Copy link
Author

p6rt commented Sep 11, 2016

@zoffixznet - 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