Skip to content

inference: add internal SOURCE_MODE_GET_SOURCE mode #57878

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

Merged
merged 2 commits into from
Mar 28, 2025

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Mar 24, 2025

Helps avoids some code duplication and divergence of inference behaviors in some edge cases

@vtjnash vtjnash added compiler:inference Type inference don't squash Don't squash merge backport 1.12 Change should be backported to release-1.12 labels Mar 24, 2025
@KristofferC KristofferC mentioned this pull request Mar 25, 2025
27 tasks
@vtjnash vtjnash force-pushed the jn/inference-SOURCE_MODE_GET_SOURCE branch from 66d49b0 to f451329 Compare March 27, 2025 15:38
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Mar 27, 2025
vtjnash added 2 commits March 27, 2025 18:25
We were previously using typeinf_code for this, but that has slightly
different semantics for recursion detection and handling of some edge
cases related to caching (e.g. seen in #57634). Overall, we would like
to avoid those sorts of spurious differences in compilation. Instead
(re)introduce a `source_mode` called `SOURCE_MODE_GET_SOURCE` which can
be used internally (requires a NativeInterpreter) here to avoid needing
to duplicate the existing `typeinf_ext` code to implement this use case.

While we are at it, also remove the code duplication for `typeinf_type`.
@vtjnash vtjnash force-pushed the jn/inference-SOURCE_MODE_GET_SOURCE branch from f451329 to 14bbb4a Compare March 27, 2025 18:25
@vtjnash vtjnash merged commit e7ff95d into master Mar 28, 2025
5 of 7 checks passed
@vtjnash vtjnash deleted the jn/inference-SOURCE_MODE_GET_SOURCE branch March 28, 2025 14:34
@KristofferC KristofferC mentioned this pull request Mar 31, 2025
36 tasks
KristofferC pushed a commit that referenced this pull request Mar 31, 2025
Helps avoids some code duplication and divergence of inference behaviors
in some edge cases, also slightly more correct caching in some edge cases.

(cherry picked from commit e7ff95d)
KristofferC pushed a commit that referenced this pull request Mar 31, 2025
Helps avoids some code duplication and divergence of inference behaviors
in some edge cases, also slightly more correct caching in some edge cases.

(cherry picked from commit e7ff95d)
@KristofferC KristofferC mentioned this pull request Apr 4, 2025
51 tasks
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Apr 9, 2025
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Apr 29, 2025
serenity4 pushed a commit to serenity4/julia that referenced this pull request May 1, 2025
Helps avoids some code duplication and divergence of inference behaviors
in some edge cases, also slightly more correct caching in some edge cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference don't squash Don't squash merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants