From 1c7224ada555401773d0db72c36be19576e37d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bartolom=C3=A4us?= Date: Mon, 20 Feb 2023 07:39:28 +0100 Subject: [PATCH] Test implementing non-multi method stubbed in role ... as multi method in class. Compare https://github.com/Raku/old-issue-tracker/issues/2901 --- S14-roles/stubs.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/S14-roles/stubs.t b/S14-roles/stubs.t index 84ff8efbf4..247fe719aa 100644 --- a/S14-roles/stubs.t +++ b/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 } }; @@ -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 }' }, 'composing stub implemented with attribute handles';