Skip to content

Commit

Permalink
Test implementing non-multi method stubbed in role
Browse files Browse the repository at this point in the history
... as multi method in class. Compare
Raku/old-issue-tracker#2901
  • Loading branch information
usev6 committed Feb 20, 2023
1 parent 262e710 commit 1c7224a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion S14-roles/stubs.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 29;
plan 30;

role WithStub { method a() { ... } };
role ProvidesStub1 { method a() { 1 } };
Expand Down Expand Up @@ -29,6 +29,10 @@ lives-ok { EVAL 'class F does WithStub does ProvidesStub1 does ProvidesStub2 {
"Interface contract enforced on stubbed multi";
}

# https://github.com/Raku/old-issue-tracker/issues/2901
eval-lives-ok q[class C2901 does WithStub { multi method a() { "OHAI" } }],
'Class can define multi method to implement non-multi method stubbed in role';

lives-ok { EVAL 'class I does WithStub {
has WithStub $.with-stub handles <a>}' },
'composing stub implemented with attribute handles';
Expand Down

0 comments on commit 1c7224a

Please sign in to comment.