-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Infinite recursion when promote_rule
depends on order of arguments
#13193
Comments
I believe this no longer causes infinite recursion in the compiler, but rather just during execution. If Here's an example of a case in Base that takes advantage of the current behavior:
However, that could be resolved by adding a disambiguating definition. After all, the first result doesn't really make sense --- a Bool cannot be converted to an |
promote_rule
depends on order of arguments
Confirmed that's still true:
|
On v1.11.3 this still causes a stack overflow only during execution, but on nightly (v1.13) this sadly again causes a stack overflow in the compiler itself. |
Don't use recursion, delete the `promote_result` function. Use loop known to terminate, because of a hardcoded limit on the iteration count. Closes JuliaLang#57507, this PR encompasses the fixes from that PR and is more comprehensive. Fixes JuliaLang#13193
Don't use recursion, delete the `promote_result` function. Use loop known to terminate, because of a hardcoded limit on the iteration count. Closes JuliaLang#57507, this PR encompasses the fixes from that PR and is more comprehensive. Fixes JuliaLang#13193
Don't use recursion, delete the `promote_result` function. Use loop known to terminate, because of a hardcoded limit on the iteration count. Closes JuliaLang#57507, this PR encompasses the fixes from that PR and is more comprehensive. Fixes JuliaLang#13193
Don't use recursion, delete the `promote_result` function. Use loop known to terminate, because of a hardcoded limit on the iteration count. Closes JuliaLang#57507, this PR encompasses the fixes from that PR and is more comprehensive. Fixes JuliaLang#13193
This is a more complicated case than #13183, and its root cause seems to be different since it persists after 9f72db1. But if you're interested in squashing these, here's an interesting case: given two
Number
wrappers that are themselves numbers and promote numbers to their type, we get an infinite recursion in the compiler/inference if they ever come into contact with each other:(via JuliaArrays/AxisArrays.jl#20 (comment))
The text was updated successfully, but these errors were encountered: