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
Very unhelpful error message for declaring a role with a name already assigned to a class #1153
Comments
From hudnix@walttollefson.com<hudnix>rakudo: role List {method foo{1}} <p6eval>rakudo 3b1bda: OUTPUT«Method '!add_variant' not found for invocant My first rakudobug... |
From @masakOn Tue Jul 21 17:05:56 2009, hudnix@walttollefson.com wrote:
Declaring an existing class as a role seems to be the culprit here. <masak> rakudo: role List {} |
From [Unknown Contact. See original ticket]On Tue Jul 21 17:05:56 2009, hudnix@walttollefson.com wrote:
Declaring an existing class as a role seems to be the culprit here. <masak> rakudo: role List {} |
@masak - Status changed from 'new' to 'open' |
From @bbkr$ perl6 -e 'role List { method foo {1.say} }; class A does List {}; Works, taken for tests. |
From @bbkrAccording to STD this should pass [16:35] <moritz_> std: role Array { } So I'm changing ticket subject |
From @bbkrtests added in |
@bbkr - Status changed from 'open' to 'resolved' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S14-roles/basic.t commit d848f22aab4c9d42abb32207dcbf1d4a39dc7860 [t/spec] tests for RT #67768 Cannot declare a role with a name already assigned to a class Inline Patchdiff --git a/t/spec/S14-roles/basic.t b/t/spec/S14-roles/basic.t
index 20d33f2..e0fc09e 100644
--- a/t/spec/S14-roles/basic.t
+++ b/t/spec/S14-roles/basic.t
@@ -143,6 +143,16 @@ eval_dies_ok '0 but RT66178', '"but" with non-existent role dies';
# RT #72848
lives_ok {0 but True}, '0 but True has applicable candidate';
+# RT #67768
+{
+ lives_ok { role List { method foo { 67768 } } },
+ 'can declare a role with a name already assigned to a class';
+ lives_ok { class C67768 does List { } },
+ 'can use a role with a name already assigned to a class';
+ is C67768.new.foo, 67768,
+ 'can call method from a role with a name already assigned to a class';
+}
+
done_testing;
# vim: ft=perl6 |
Migrated from rt.perl.org#67768 (status was 'resolved')
Searchable as RT67768$
The text was updated successfully, but these errors were encountered: