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

__CANDIDATE_LIST__ not found trying to define custom routine trait #1368

Closed
p6rt opened this issue Oct 19, 2009 · 7 comments
Closed

__CANDIDATE_LIST__ not found trying to define custom routine trait #1368

p6rt opened this issue Oct 19, 2009 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Oct 19, 2009

Migrated from rt.perl.org#69893 (status was 'resolved')

Searchable as RT69893$

@p6rt
Copy link
Author

p6rt commented Oct 19, 2009

From @mathw

15​:22 <@​mathw> rakudo​: role woowoo {}; multi trait_mod​:<is>(Routine $c, woowoo)
  { $c.wrap​: sub { say "Woowoo" } }; sub foo is woowoo { say "foo"
  }; foo();
15​:22 < p6eval> rakudo 827734​: OUTPUT«Lexical '__CANDIDATE_LIST__' not found␤in
  Main (file src/gen_setting.pm, line 206)␤»

Not good

@p6rt
Copy link
Author

p6rt commented Oct 22, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S14-traits/routines.t

commit fc49b0b54fe7d1a6e4f342c54dfac79dc9a25736
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Thu Oct 22 19​:59​:04 2009 +0000

  [t/spec] Tests for RT #​69893, wrapping subroutines in traits
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28885 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --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

@p6rt
Copy link
Author

p6rt commented Oct 22, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 1, 2011

From @moritz

The traits spec has changed quite a bit, so this is what it would look
like now​:

multi trait_mod​:<is>(Routine $c, :$woowoo!) {
  $c.wrap​: sub { say "Woowoo" }
};
sub foo is woowoo { say "foo" }; foo();

And in current rakudo it fails, because Routine.wrap is not yet
implemented again; but the underlying issue seems to be gone.

@p6rt
Copy link
Author

p6rt commented Jan 13, 2012

From @jnthn

On Sat Oct 01 03​:21​:58 2011, moritz wrote​:

The traits spec has changed quite a bit, so this is what it would look
like now​:

multi trait_mod​:<is>(Routine $c, :$woowoo!) {
$c.wrap​: sub { say "Woowoo" }
};
sub foo is woowoo { say "foo" }; foo();

And in current rakudo it fails, because Routine.wrap is not yet
implemented again; but the underlying issue seems to be gone.

Works for me now​:

multi trait_mod​:<is>(Routine $c, :$woowoo!) { $c.wrap​: sub { say
"Woowoo" } }; sub foo is woowoo { say "foo" }; foo();
Woowoo

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Feb 3, 2012

From @moritz

Test passes, closing ticket.

@p6rt
Copy link
Author

p6rt commented Feb 3, 2012

@moritz - Status changed from 'open' to 'resolved'

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

No branches or pull requests

1 participant