Newly created type variables get exactly the jkind from the annotation #3980
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.
Change type annotations on new variables from being upper bounds to being exact values. This makes examples like
val f : ('a : value_or_null) -> 'a
check'a : value_or_null
properly instead of confusingly inferring'a : value
.Unfortunately, this makes typechecking dependent on the order annotations:
val f2 : ('a : value_or_null) -> 'a -> 'a
infers'a : value_or_null
, butval f2' : 'a -> ('a : value_or_null) -> 'a
infers'a : value
. We can probably fix this too, by defaulting only at the end when we know there are no annotations on'a
.It also would be nice to require equality instead of subkinding here. Perhaps it's not OCaml-y, but it's way less confusing.