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
can use at most one statement declaration form in entire chain of includes in Rakudo #1179
Comments
From @masakThe scenario is simple: modules A.pm and B.pm both use the statement $ cat A.pm role A; I'd expect the restriction on statement-form declarations to be |
From @pmichaudNow corrected in 426942a: $ cat A.pm role A; $ ./perl6 A.pm I'll leave the ticket open to see if we can come up with a good way to Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in at least one of these files: t/spec/S11-modules/nested.t, t/spec/packages/RoleA.pm, t/spec/packages/RoleB.pm commit 6a963e08bbbf22ea362a4b11fb1dc9be50a286b0 [t/spec] tests for RT #67976 Inline Patchdiff --git a/t/spec/S11-modules/nested.t b/t/spec/S11-modules/nested.t
index 78c557d..1eb3b0c 100644
--- a/t/spec/S11-modules/nested.t
+++ b/t/spec/S11-modules/nested.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 4;
+plan 6;
# test that classes and roles declared in modules get into the correct
# namespace
@@ -15,6 +15,16 @@ eval_lives_ok 'use A::A; A::B::D ~~ A::B::B or die()',
eval_lives_ok 'use A::A; A::B::D.new()',
'... and instantiation works';
-eval_lives_ok 'use A; A.new()', 'RT #62162';
+eval_lives_ok 'use A; A.new()', 'RT 62162';
+
+eval_lives_ok 'use RoleA',
+ 'can use multiple "Role $name" statements (in multiple files) RT 67976';
+
+{
+ use RoleA;
+
+ class MyFu does RoleB;
+ ok MyFu ~~ RoleB, 'Composition worked';
+}
# vim: ft=perl6
diff --git a/t/spec/packages/RoleA.pm b/t/spec/packages/RoleA.pm
new file mode 100644
index 0000000..87db6ad
--- /dev/null
+++ b/t/spec/packages/RoleA.pm
@@ -0,0 +1,6 @@
+BEGIN { @*INC.push: 't/spec/packages' }
+use RoleB;
+
+role RoleA;
+
+# vim: ft=perl6
diff --git a/t/spec/packages/RoleB.pm b/t/spec/packages/RoleB.pm
new file mode 100644
index 0000000..0675e4d
--- /dev/null
+++ b/t/spec/packages/RoleB.pm
@@ -0,0 +1,3 @@
+role RoleB;
+
+# vim: ft=perl6 |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#67976 (status was 'resolved')
Searchable as RT67976$
The text was updated successfully, but these errors were encountered: