I am sure about that

&infix:<~>.cando(\(3,('a'|'b'))».signature.say
# ((*@args --> Str:D))
&infix:<~>.cando(\('x',('a'|'b')))».signature.say
# ((Str:D $a, Junction:D $b) (*@args --> Str:D))

Since there is a Junction candidate (or rather three), there is
probably a reason for it.

Also if you turn the 3 into a Junction it also starts to work

any(3) ~ ('a'|'b')
# any(3a, 3b)

On Sun, Dec 23, 2018 at 2:22 AM JJ Merelo <jjmer...@gmail.com> wrote:
>
>
>
> El dom., 23 dic. 2018 a las 7:39, Brad Gilbert (<b2gi...@gmail.com>) escribió:
>>
>> I turns out there is a candidate for
>>
>> Str:D, Junction:D
>>
>> but not for
>>
>> Any:D, Junction:D
>>
>> so it is going through one of the other &infix:<~> candidates,
>> specifically it looks like it could be
>>
>> *@args
>>
>> Which doesn't apparently work with Junctions. So yes it is a bug.
>
>
> Um, not sure about that. One might expect a distributive property of the kind 
> a ~ f(b,c) would do something like f(a~b, a~c), but this does not need to 
> apply in this case, maybe because in this particular Any case a~b and the 
> rest would work, but not in general (because there might not be a sensible 
> stringification of a). This works, for instance: say '3' ~ (3|'4')
> If you think it's a bug, or simply inconsistent behavior, you could file an 
> issue, anyway. But I'm not so sure in this case.
>
> Cheers
>
> JJ

Reply via email to