There were two different problems here:

1) It was not possible to flatten an array within \(...).

This has been fixed:

$ perl6 -e 'my @t = 1, 2; say \(|@t)'
\(1, 2)

[BTW: It was possible to do 'Capture(|@t)' before, only with the unary 
backslash operator it didn't work.]

The smartmatch from the OP also works with |@t (but it fails as expected 
without flattening the array).

$ perl6 -e 'class A { method foo (Int) {} }; my @t = 1; say \(A, |@t) ~~ 
A.^find_method("foo").signature;'
True

$ perl6 -e 'class A { method foo (Int) {} }; my @t = 1; say \(A, @t) ~~ 
A.^find_method("foo").signature;'
False

I added a test to S02-types/capture.t with commit 
https://github.com/perl6/roast/commit/7c4672ced8

2) Capture.perl flattens elements.

This is still an issue, but there is a separate ticket: 
https://rt.perl.org/Ticket/Display.html?id=114100. I'll link to that ticket, 
but since the main issue 1) is solved, I'm going to close this ticket as 
'resolved'.

Reply via email to