You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a module explicitly uses a symbol as a namespace, it cannot export a class or role as that symbol name.
$ cat > /tmp/f1.pm6
module f1 {
class A::B { }
class A is export { }
}
$ PERL6LIB=/tmp perl6 -e "use f1"
===SORRY!=== Error while compiling -e
Cannot import symbol A from f1, because it already exists in this lexical scope
at -e:1
------> use f1⏏<EOL>
$ cat > /tmp/f1.pm6
module f1 {
my $A::B;
class A is export { }
}
$ PERL6LIB=/tmp perl6 -e "use f1"
===SORRY!=== Error while compiling -e
Cannot import symbol A from f1, because it already exists in this lexical scope
at -e:1
------> use f1⏏<EOL>
This appears to be due to the namespace symbol being imported even though nothing in it exports...
$ cat /tmp/f1.pm6
module f1 {
my $A::B = 42
}
$ PERL6LIB=/tmp perl6 -e "use f1; say ::(A)"
Use of uninitialized value of type A in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at -e line 1
No such symbol ''
in block <unit> at -e line 1
Actually thrown at:
in block <unit> at -e line 1
$ PERL6LIB=/tmp perl6 -e "say ::(A)"
===SORRY!=== Error while compiling -e
Undeclared name:
A used at line 1
(I think this is a newish behavior but couldn't figure out how to get bisectable to handle a precomp)
Migrated from rt.perl.org#130794 (status was 'new')
Searchable as RT130794$
The text was updated successfully, but these errors were encountered: