Make most jkinds created from sort variables Maybe_null. This allows types like or_null in function arguments, function results, record fields and so on. This excludes:
Unannotated type parameters for compatibility reasons
Jkinds created by transl_simple_type ~new_var_jkind:Sort
Changing any of those to accept or_null breaks compatibility with existing code due to more permissive type inference in signatures
Array elements, to prohibit float or_null array
Accept value_or_null for the V1 safety check, for the separability check, for tuple elements, for structure elements, and for polymorphic variant fields.
Require array type parameters to be non-null.
Hide value_or_null and any_non_null from users if the layouts extension is below Alpha, replacing them with value or any in the compiler output.
Convert any annotations to any_non_null if the layouts extension is below Alpha for compatibility with existing code using arrays.
Split some tests into alpha and non-alpha versions due to different printing behavior.
Tests in typing-layouts-or-null cover some changes in this PR, but not all. More tests will be added in the PR implementing the or_null type.
Make most jkinds created from sort variables
Maybe_null
. This allows types likeor_null
in function arguments, function results, record fields and so on. This excludes:transl_simple_type ~new_var_jkind:Sort
or_null
breaks compatibility with existing code due to more permissive type inference in signaturesfloat or_null array
Accept
value_or_null
for the V1 safety check, for the separability check, for tuple elements, for structure elements, and for polymorphic variant fields.Require array type parameters to be non-null.
Hide
value_or_null
andany_non_null
from users if the layouts extension is belowAlpha
, replacing them withvalue
orany
in the compiler output.Convert
any
annotations toany_non_null
if the layouts extension is belowAlpha
for compatibility with existing code using arrays.Split some tests into alpha and non-alpha versions due to different printing behavior.
Tests in
typing-layouts-or-null
cover some changes in this PR, but not all. More tests will be added in the PR implementing theor_null
type.