Conversation
When encountering complicated cycles within cycles, make sure to revisit
all applicable methods explicitly, since not all methods within the
cycle will necessarily change return type after resolving the cycle.
This shows up as the possibility of frames that don't get revisited
before being cached, probably just caching `Union{}` as the call type
instead. I always assumed this code was probably wrong, but didn't have
any way to construct the counter-example to have confidence that fixing
it would not cause some other side-effect. But still keep the backedge
work lazy, since we don't want to allocate unnecessarily for a rarely
used feature (recursion).
Fix #59943
Member
This is true but this wording is just hilarious 😂 |
Member
|
Tested and confirmed that this fixes the MWE from @AayushSabharwa. @vtjnash do you have a simpler mwe now that you know what the problem was? |
4f4b3c9 to
5fcbcf3
Compare
Member
Author
|
You're welcome to write tests. I have no more idea how to write one now than when I did when I didn't write this code years ago. |
KristofferC
pushed a commit
that referenced
this pull request
Nov 7, 2025
When encountering complicated cycles within cycles, make sure to revisit
all applicable methods explicitly, since not all methods within the
cycle will necessarily change return type after resolving the cycle.
This shows up as the possibility of frames that don't get revisited
before being cached, probably just caching `Union{}` as the call type
instead. I always assumed this code was probably wrong, but didn't have
any way to construct the counter-example to have confidence that fixing
it would not cause some other side-effect. But still keep the backedge
work lazy, since we don't want to allocate unnecessarily for a rarely
used feature (recursion).
Fix #59943
(cherry picked from commit f4847bf)
This was referenced Jan 14, 2026
kpamnany
pushed a commit
to RelationalAI/julia
that referenced
this pull request
Jan 21, 2026
When encountering complicated cycles within cycles, make sure to revisit
all applicable methods explicitly, since not all methods within the
cycle will necessarily change return type after resolving the cycle.
This shows up as the possibility of frames that don't get revisited
before being cached, probably just caching `Union{}` as the call type
instead. I always assumed this code was probably wrong, but didn't have
any way to construct the counter-example to have confidence that fixing
it would not cause some other side-effect. But still keep the backedge
work lazy, since we don't want to allocate unnecessarily for a rarely
used feature (recursion).
Fix JuliaLang#59943
(cherry picked from commit f4847bf)
45 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When encountering complicated cycles within cycles, make sure to revisit all applicable methods explicitly, since not all methods within the cycle will necessarily change return type after resolving the cycle. This shows up as the possibility of frames that don't get revisited before being cached, probably just caching
Union{}as the call type instead. I always assumed this code was probably wrong, but didn't have any way to construct the counter-example to have confidence that fixing it would not cause some other side-effect. But still keep the backedge work lazy, since we don't want to allocate unnecessarily for a rarely used feature (recursion).Fix #59943