On Wed, 31 Jan 2018 07:26:24 -0800, pawel.pab...@getresponse.com wrote:
> $ perl6 -e 'sub MAIN ( $x = 1|2 ) { }'
> 
> Following oneliner will hang forever on Rakudo 2018.01.
> Error exists for all type of Junctions.
> Doesn't matter if they are built by infix "1|2" or by method "any(1,2)".

We can probably improve that behaviour with an error message (it applies to any 
routine, not just MAIN).

The problem is you're declaring an Any parameter, but your default value is a 
Junction, so when the default is used, it's trying to autothread the Junction 
and I'm guessing it keeps looping there in the guts somewhere.

Looking at your use, I'm suspecting you meant to use a `where` clause instead 
of the default value:

    `perl6 -e 'sub MAIN ( $x where 1|2 ) { }' 

Reply via email to