PugsBugs: Code Block as sub args

1 view
Skip to first unread message

Stevan Little

unread,
Apr 17, 2005, 12:35:38 PM4/17/05
to perl6-c...@perl.org
So I am trying to implement throws_ok into Test.pm and I ran into this
bug:

pugs -e 'sub foo (Sub $code, Str $a, Str ?$b) { ref($a).say }; foo ->
{ "test" }, "test", "test2";'
prints:
List

I also tried a number of other versions of this as well this one is the
only one which works:

pugs -e 'sub foo (Sub $code, Str $a, Str ?$b) { ref($a).say }; my
$block = { die "test" }; foo $block, "test", "test2";'
it prints:
Str

Attached is a t/pugsbugs/ test for it.

- Stevan

code_blocks_as_sub_args.t
Reply all
Reply to author
Forward
0 new messages