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
__CANDIDATE_LIST__ not found trying to define custom routine trait #1368
Comments
From @mathw15:22 <@mathw> rakudo: role woowoo {}; multi trait_mod:<is>(Routine $c, woowoo) Not good |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S14-traits/routines.t commit fc49b0b54fe7d1a6e4f342c54dfac79dc9a25736 [t/spec] Tests for RT #69893, wrapping subroutines in traits Inline Patchdiff --git a/t/spec/S14-traits/routines.t b/t/spec/S14-traits/routines.t
index d7e4691..a43c77f 100644
--- a/t/spec/S14-traits/routines.t
+++ b/t/spec/S14-traits/routines.t
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 8;
+plan *;
# L<S14/Traits/>
@@ -38,4 +38,20 @@ is &cheezburger.description, 'tasty', 'named trait handler applied other role s
is lolcat(), "undescribable", 'can call sub that has had a trait applied to it by named param without arg';
is &lolcat.description, 'missing description!', 'named trait handler applied other role without argument';
+#?rakudo skip 'RT 69893'
+{
+ my $recorder = '';
+ role woowoo { }
+ multi trait_mod:<is>(Routine $c, woowoo) {
+ $c.wrap: sub {
+ $recorder ~= 'wrap';
+ }
+ }
+ sub foo is woowoo { };
+ lives_ok &foo, 'Can call subroutine that was wrapped by a trait';
+ is $recorder, 'wrap', 'and the wrapper has been called once';
+}
+
+done_testing();
+
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzThe traits spec has changed quite a bit, so this is what it would look multi trait_mod:<is>(Routine $c, :$woowoo!) { And in current rakudo it fails, because Routine.wrap is not yet |
From @jnthnOn Sat Oct 01 03:21:58 2011, moritz wrote:
Works for me now:
Tagging testneeded. /jnthn |
From @moritzTest passes, closing ticket. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#69893 (status was 'resolved')
Searchable as RT69893$
The text was updated successfully, but these errors were encountered: