Skip to content
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

multi from parent which does same role doesn't work #5462

Open
p6rt opened this issue Jul 18, 2016 · 2 comments
Open

multi from parent which does same role doesn't work #5462

p6rt opened this issue Jul 18, 2016 · 2 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 18, 2016

Migrated from rt.perl.org#128657 (status was 'new')

Searchable as RT128657$

@p6rt
Copy link
Author

p6rt commented Jul 18, 2016

From @LLFourn

role R { proto method foo {*} };

class A does R { multi method foo { say "A" } };

class B is A does R { };

B.foo

===
Use of uninitialized value of type Any in string context

Any of .^name, .perl, .gist, or .say can stringify undefined things, if
needed
in block <unit> at -e line 1

Cannot resolve caller foo(B); none of these signatures match​:
in block <unit> at -e line 1'

My opinion is that B should clone the dispatcher from A. Any candidates
added in B would then be added to it. In any case, candidate merging should
be smarter in classes that do the same role IMO.

@p6rt p6rt added the Bug label Jan 5, 2020
@usev6
Copy link

usev6 commented Oct 6, 2023

Current behaviour:

$ ./rakudo-m -e 'role R { proto method foo {*} }; class A does R { multi method foo { say "A" } }; class B is A does R {}; B.foo'
Cannot resolve caller foo(B:U); Routine does not have any candidates.  Is only the proto defined?
  in block <unit> at -e line 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants