Repository navigation
Use generic types in call to subtype - #13464
Merged
Merged
Conversation
Contributor
Author
garrigue
approved these changes
Oct 8, 2024
garrigue
left a comment
Contributor
There was a problem hiding this comment.
The code is modified the way we discussed, giving the improved behavior on single coercions.
The modified output for recursive types is a bit confusing, but the types are semantically equivalent. Eventually it may be worth defining better the amount of unsharing caused by annotations.
goldfirere
force-pushed
the
generic-instance-in-subtype
branch
from
October 8, 2024 14:38
566d565 to
c9872ee
Compare
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 is a small change within the type-checker to use generic-level types in the call to
subtype, used to implement the:>operator.The change here causes no known change in behavior. However, in Jane Street's branch, we sometimes use information about whether a type in principally known to make decisions about which modes to pay attention to; this change does make a differece in that branch. The reason I'm posting it here is that I think this small change in the code makes it a bit more semantically correct: the types in question are written by the user and therefore really should be treated at generic-level.
I think @garrigue is the right reviewer for this.