New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi sub infix:<==> (Int $a, Str $b) { $a == $b } hangs in COMPILE time #5101
Comments
From @bbkrmulti sub infix:<==> (Int $a, Str $b) { $a == $b } Will never finish compilation on Rakudo 6.c and causes severe memory leak. I found that: 1. Types must be different in signature 2. Operator must be the same in sub and block |
From @zoffixznetOn Fri Jan 29 06:50:08 2016, pawel.pabian@getresponse.com wrote:
Thanks for the report. I'm unsure whether this would qualify as a bug, but jnthn++ wanted to know more about this The body of the multi you're creating calls itself, which causes infinite recursion, hence the hang and memory growth. The reason you see this happen during compile time is due to routine inlining optimizations. You can see that perl6 --optimize=0 -e 'multi sub infix:<==> (Int $a, Str $b) { $a == $b }' # doesn't hang The reason (Int $a, Int $b) compiles is because it's ambiguous with the Int:D, Int:D candidate defined in core, Using a different operator, as you described in point (2), simply avoids using the same operator in the body, and Digging into the optimizer, it inlines the hanging multi, then runs the optimizer over it again, inlines it again, and Here's the call graph for the infini-looping portion: visit_op I also added a print statement to start of every method and sub in Optimizer.nqp and here's the repeating portion of the calls: CALLING -> in visit_op Cheers, |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#127421 (status was 'open')
Searchable as RT127421$
The text was updated successfully, but these errors were encountered: