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
Type 'M0::C1' is not declared
at /home/marcel/Languages/Perl6/Tests/Class/moc1.pl6:8
------> has M0::C1⏏ $!c1;
Malformed has
at /home/marcel/Languages/Perl6/Tests/Class/moc1.pl6:8
------> has M0::⏏C1 $!c1;
from the following code;
The program m0c1.pl6
#!/usr/bin/env perl6
use v6.c;
use M0::C1;
class xyz { # same for package and module
class M0 {
has M0::C1 $!c1;
}
}
my $c1 = xyz::M0.new;
and the file M0/C1.pm6
use v6.c;
class M0::C1 {}
Error disappears when outer class(xyz) is removed and 'my $c1 =
xyz::M0.new;' is changed into
'my $c1 = M0.new;'
As an alternative the error also disappears when renaming the inner
class into Mx0 and change 'my $c1 = xyz::M0.new;' into 'my $c1 =
xyz::Mx0.new;'.
And this one helps too and is maybe the recommended way to do; rewrite
'has M0::C1 $!c1;' into 'has ::M0::C1 $!c1;'.
So 1) the message is not helpful and 2) it doesn't show a consequent
behavior if I look at the last two workarounds.
Migrated from rt.perl.org#128854 (status was 'new')
Searchable as RT128854$
The text was updated successfully, but these errors were encountered: