Skip to content
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

inference: override return type inference by const-prop more carefully #44282

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

aviatesk
Copy link
Member

A return type derived by const-prop' inference can be wider than that of
non const-prop' inference in rare cases e.g. when there are cycles but
cached result is still accurate. This commit checks if the const-prop'ed
result is really more accurate than non-const result.

fix Ferrite-FEM/Tensors.jl#178

@aviatesk aviatesk added backport 1.8 Change should be backported to release-1.8 compiler:inference Type inference labels Feb 20, 2022
@vtjnash
Copy link
Member

vtjnash commented Feb 20, 2022

Is this reverting e3b681c?

@aviatesk
Copy link
Member Author

aviatesk commented Feb 21, 2022

When compared to pre- e3b681c logic, now we use const-prop'ed return type and source even if the const_rt !== rt condition doesn't hold (but still we check const_rt ⊑ rt).

A return type derived by const-prop' inference can be wider than that of
non const-prop' inference in rare cases e.g. when there are cycles but
cached result is still accurate. This commit checks if the const-prop'ed
result is really more accurate than non-const result.

fix Ferrite-FEM/Tensors.jl#178
@aviatesk aviatesk merged commit 1777553 into master Feb 21, 2022
@aviatesk aviatesk deleted the avi/constrt branch February 21, 2022 06:15
aviatesk added a commit that referenced this pull request Feb 21, 2022
#44282)

A return type derived by const-prop' inference can be wider than that of
non const-prop' inference in rare cases e.g. when there are cycles but
cached result is still accurate. This commit checks if the const-prop'ed
result is really more accurate than non-const result.

fix Ferrite-FEM/Tensors.jl#178
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label Feb 24, 2022
staticfloat pushed a commit to JuliaCI/julia-buildkite-testing that referenced this pull request Mar 2, 2022
JuliaLang#44282)

A return type derived by const-prop' inference can be wider than that of
non const-prop' inference in rare cases e.g. when there are cycles but
cached result is still accurate. This commit checks if the const-prop'ed
result is really more accurate than non-const result.

fix Ferrite-FEM/Tensors.jl#178
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
JuliaLang#44282)

A return type derived by const-prop' inference can be wider than that of
non const-prop' inference in rare cases e.g. when there are cycles but
cached result is still accurate. This commit checks if the const-prop'ed
result is really more accurate than non-const result.

fix Ferrite-FEM/Tensors.jl#178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inference error in Julia 1.8
3 participants