-
Notifications
You must be signed in to change notification settings - Fork 1
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
doing a role fails to find inherited methods in some cases #6367
Comments
From @zoffixznetMu provides iterator method, but when you mix in a role that wants it implemented, it doesn't find it: m: role Meow { method iterator {…} }; class Bar does Meow {} Yet it all works fine if you are also doing `is SomethingUnrelated`: m: class Foo { method x {} }; role Meow { method iterator {…} }; class Bar is Foo does Meow {} |
From @zoffixznetOn Thu, 29 Jun 2017 03:46:02 -0700, cpan@zoffix.com wrote:
Another example turned up; fails to notice the method is provided by `handles`: class HTTP::Header does Associative does Iterable { has %!fields of StrOrArrayOfStr method Str { #`[not shown, for brevity] } This is from Raku/doc#1438 |
From @skidsOn Mon, 07 Aug 2017 08:25:10 -0700, cpan@zoffix.com wrote:
I've traced this as far back as RoleToClassApplier.has_method It will then get Any/Mu thereby. Unless that "is" was an # This fails... .elems is from Any and compute_mro recurses It looks like with a not-yet-composed class C3MRI.compute_mro $ perl6 -e 'role Meow { method split {...} }; class Boo { }; class Bar does Meow { method split { 42 } }; Bar.^mro.say' ...the code in C3MRO if left to its own devices would have Tracing it back up, if you look several lines under the call to |
The RT System itself - Status changed from 'new' to 'open' |
From @skidsOn Mon, 07 Aug 2017 08:25:10 -0700, cpan@zoffix.com wrote:
Rakudo PR request 1170 submitted to address this. With that patch applied both above examples work and this still fails, as it should: $ perl6 -e 'class Foo { method x {} }; role Meow { method elems {…} }; class Bar is Mu does Meow {}' |
As a status update: The code from the original post doesn't die anymore (and neither does the code from the first response).
And the evaluation from the last response, which is supposed to die, dies:
So, it looks like this could be closed. But we should check if this is covered by tests. |
Migrated from rt.perl.org#131676 (status was 'open')
Searchable as RT131676$
The text was updated successfully, but these errors were encountered: