#14629: update is_inferred to traverse local opens#14638
Merged
nojb merged 2 commits intoocaml:trunkfrom Mar 10, 2026
Merged
Conversation
nojb
approved these changes
Mar 10, 2026
Contributor
nojb
left a comment
There was a problem hiding this comment.
LGTM
Thanks @Octachron for the speedy fix!
typing/typecore.ml
Outdated
| | Pexp_coerce _ | Pexp_send _ | Pexp_new _ | Pexp_pack (_, Some _) -> true | ||
| | Pexp_sequence (_, e) -> is_inferred e | ||
| | Pexp_ifthenelse (_, e1, Some e2) -> is_inferred e1 && is_inferred e2 | ||
| | Pexp_struct_item( { pstr_desc= Pstr_open _; _ }, e ) -> is_inferred e |
Contributor
There was a problem hiding this comment.
A comment may be useful to a future reader to underestand why we only treat this case here.
Suggested change
| | Pexp_struct_item( { pstr_desc= Pstr_open _; _ }, e ) -> is_inferred e | |
| | Pexp_struct_item( { pstr_desc= Pstr_open _; _ }, e ) -> is_inferred e (* PR #14638 *) |
Member
Author
There was a problem hiding this comment.
Added a comment with a link to the issue which seemed more informative than this PR.
local opens
nojb
pushed a commit
that referenced
this pull request
Mar 10, 2026
* type: update is_inferred to traverse Pexp_structure_item * review: comment (cherry picked from commit 7c51f06)
Contributor
|
Cherry-picked to 5.5 8633136 |
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.
This PR restores the inlining of
|>inx |> M.(f y)by preserving the previous behaviour of theis_inferredfunction in this specific case.I had considered making this function traverses all
Pexp_structure_item _but the function feels quite adhoc to me, and thus preserving the previous behaviour seems like a good first step.Fixes #14629
cc @nojb