[refactoring] minor improvements to pattern typing#12531
Merged
gasche merged 3 commits intoocaml:trunkfrom Sep 12, 2023
Merged
Conversation
b40b6db to
a94791b
Compare
Octachron
reviewed
Sep 12, 2023
(I'm not sure what 'fixed' means here, it comes all the way from 0a82360 without documentation, but it is better to have the parameter name at the callsite than to know nothing at all.)
a94791b to
2c53a09
Compare
Octachron
approved these changes
Sep 12, 2023
Member
Octachron
left a comment
There was a problem hiding this comment.
The changes in the typedtree printer look useful, and I agree that decreasing boolean blindness increases readability here (in particular for the partiality_flag argument).
Member
Author
|
The AppVeyor failure is due to the flaky test forbidden.ml -- unrelated. Merging. Thanks! |
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.
I was trying to re-read the code computing partiality of pattern-matching in the type-checker and to test it. This PR contains three independent, minor improvements:
-dtypedtreeoutput; because Total is vastly more frequent, only change the printing when Partialpartial_flagargument totype_pat(one ofpartial_flag:trueandpartial_flag:falsemeans that we know that the match is partial without checking; can you guess which one?)fixedargument ofinstance_polyandinstance_label(not obviously related: it was the last remaining unlabeled boolean arguments used in Typecore)The patches should not change the behavior of the compiler (except the
-dtypedtreeoutput) and they should be trivial to review. They could be rejected if you found them (1) not useful or (2) not improving readability.