[perl #132794] Junction as default value of MAIN param hangs forever

[email protected] ("Zoffix Znet via RT")
Newsgroups perl.perl6.compiler
Message-ID <[email protected]>
On Wed, 31 Jan 2018 07:26:24 -0800, [email protected] 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 ) { }'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.