Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the nullability axis for jkinds #2731

Merged
merged 21 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Default more types to non-null
  • Loading branch information
d-kalinichenko committed Jul 1, 2024
commit ece16c1e01d171fe41f93f92d85ab5f85d76e114
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/typing-layouts-arrays/basics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ end
Line 9, characters 24-35:
9 | let f2 idx : int32# = get arr idx
^^^^^^^^^^^
Error: This expression has type ('a : float64 mod non_null)
Error: This expression has type ('a : float64)
but an expression was expected of type int32#
The layout of int32# is bits32, because
it is the primitive bits32 type int32#.
Expand Down
4 changes: 2 additions & 2 deletions ocaml/testsuite/tests/typing-layouts/layout_poly.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Line 4, characters 63-68:
4 | let () = Format.printf "%f %s\n" (F.to_float (id' #1.)) (id' "abc")
^^^^^
Error: This expression has type string but an expression was expected of type
('a : float64 mod non_null)
('a : float64)
The layout of string is value, because
it is the primitive value type string.
But the layout of string must be a sublayout of float64, because
Expand Down Expand Up @@ -543,7 +543,7 @@ external id : ('a : any) ('b : any). 'a -> 'b = "%identity" [@@layout_poly]
Line 2, characters 28-32:
2 | let f (x: float#): int64# = id x
^^^^
Error: This expression has type ('a : float64 mod non_null)
Error: This expression has type ('a : float64)
but an expression was expected of type int64#
The layout of int64# is bits64, because
it is the primitive bits64 type int64#.
Expand Down
2 changes: 1 addition & 1 deletion ocaml/typing/jkind.ml
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ module Const = struct
{ layout = jkind.layout;
modes_upper_bounds = Modes.max;
externality_upper_bound = Externality.max;
nullability_upper_bound = Nullability.max
nullability_upper_bound = Nullability.Non_null
};
name = Layout.Const.to_string jkind.layout
}
Expand Down