Skip to content

Commit

Permalink
flambda-backend: Revert non-null PRs (ocaml-flambda#2658)
Browse files Browse the repository at this point in the history
* Revert "Unboxed records may be null (ocaml-flambda#2648)"

This reverts commit 771f0bc.

* Revert "Define `'a or_null` (ocaml-flambda#2614)"

This reverts commit c73c6fc.

* Revert "Make various primitives `non_null_value` (ocaml-flambda#2604)"

This reverts commit fd39aec.

---------

Co-authored-by: Diana Kalinichenko <[email protected]>
  • Loading branch information
dkalinichenko-js and d-kalinichenko authored Jun 5, 2024
1 parent 53831cf commit 49c625c
Show file tree
Hide file tree
Showing 25 changed files with 457 additions and 1,790 deletions.
2 changes: 1 addition & 1 deletion otherlibs/alpha/dune
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
(rule
(deps
(glob_files ../stdlib_alpha/*.{ml,mli}))
(targets alpha.ml alpha.mli or_null.ml or_null.mli)
(targets alpha.ml alpha.mli)
(action
(bash
"cp ../stdlib_alpha/*.{ml,mli} .; mv stdlib_alpha.ml alpha.ml; mv stdlib_alpha.mli alpha.mli")))
Expand Down
17 changes: 0 additions & 17 deletions otherlibs/stdlib_alpha/or_null.ml

This file was deleted.

18 changes: 0 additions & 18 deletions otherlibs/stdlib_alpha/or_null.mli

This file was deleted.

1 change: 0 additions & 1 deletion otherlibs/stdlib_alpha/stdlib_alpha.ml
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
module Or_null = Or_null
1 change: 0 additions & 1 deletion otherlibs/stdlib_alpha/stdlib_alpha.mli
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
module Or_null = Or_null
16 changes: 8 additions & 8 deletions testsuite/tests/ppx-empty-cases/test.compilers.reference
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
(empty_cases_returning_string/269 =
(function {nlocal = 0} param/271
(raise
(makeblock 0 (getpredef Match_failure/33!!) [0: "test.ml" 28 50])))
(makeblock 0 (getpredef Match_failure/32!!) [0: "test.ml" 28 50])))
empty_cases_returning_float64/272 =
(function {nlocal = 0} param/274 : unboxed_float
(raise
(makeblock 0 (getpredef Match_failure/33!!) [0: "test.ml" 29 50])))
(makeblock 0 (getpredef Match_failure/32!!) [0: "test.ml" 29 50])))
empty_cases_accepting_string/275 =
(function {nlocal = 0} param/277
(raise
(makeblock 0 (getpredef Match_failure/33!!) [0: "test.ml" 30 50])))
(makeblock 0 (getpredef Match_failure/32!!) [0: "test.ml" 30 50])))
empty_cases_accepting_float64/278 =
(function {nlocal = 0} param/280[unboxed_float]
(raise
(makeblock 0 (getpredef Match_failure/33!!) [0: "test.ml" 31 50])))
(makeblock 0 (getpredef Match_failure/32!!) [0: "test.ml" 31 50])))
non_empty_cases_returning_string/281 =
(function {nlocal = 0} param/283
(raise
(makeblock 0 (getpredef Assert_failure/43!!) [0: "test.ml" 32 68])))
(makeblock 0 (getpredef Assert_failure/42!!) [0: "test.ml" 32 68])))
non_empty_cases_returning_float64/284 =
(function {nlocal = 0} param/286 : unboxed_float
(raise
(makeblock 0 (getpredef Assert_failure/43!!) [0: "test.ml" 33 68])))
(makeblock 0 (getpredef Assert_failure/42!!) [0: "test.ml" 33 68])))
non_empty_cases_accepting_string/287 =
(function {nlocal = 0} param/289
(raise
(makeblock 0 (getpredef Assert_failure/43!!) [0: "test.ml" 34 68])))
(makeblock 0 (getpredef Assert_failure/42!!) [0: "test.ml" 34 68])))
non_empty_cases_accepting_float64/290 =
(function {nlocal = 0} param/292[unboxed_float]
(raise
(makeblock 0 (getpredef Assert_failure/43!!) [0: "test.ml" 35 68]))))
(makeblock 0 (getpredef Assert_failure/42!!) [0: "test.ml" 35 68]))))
(makeblock 0 empty_cases_returning_string/269
empty_cases_returning_float64/272 empty_cases_accepting_string/275
empty_cases_accepting_float64/278 non_empty_cases_returning_string/281
Expand Down
4 changes: 2 additions & 2 deletions testsuite/tests/typing-layouts-err-msg/annots.ml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Line 1, characters 9-33:
^^^^^^^^^^^^^^^^^^^^^^^^
Error: This alias is bound to type 'a -> int
but is used as an instance of type ('b : void)
The layout of 'a -> int is non_null_value, because
The layout of 'a -> int is value, because
it's a function type.
But the layout of 'a -> int must be a sublayout of void, because
of the annotation on the type variable 'b.
Expand All @@ -104,7 +104,7 @@ Line 1, characters 27-31:
1 | type t = 'a -> int as (_ : void)
^^^^
Error: Bad layout annotation:
The layout of 'a -> int is non_null_value, because
The layout of 'a -> int is value, because
it's a function type.
But the layout of 'a -> int must be a sublayout of void, because
of the annotation on the wildcard _ at line 1, characters 27-31.
Expand Down
18 changes: 9 additions & 9 deletions testsuite/tests/typing-layouts-err-msg/value.ml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ type r : void = {a:string}
Line 1, characters 0-26:
1 | type r : void = {a:string}
^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: The layout of type r is non_null_value, because
Error: The layout of type r is value, because
it's a boxed record type.
But the layout of type r must be a sublayout of void, because
of the annotation on the declaration of the type r.
Expand All @@ -133,7 +133,7 @@ type v : void = A of t_value
Line 1, characters 0-28:
1 | type v : void = A of t_value
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: The layout of type v is non_null_value, because
Error: The layout of type v is value, because
it's a boxed variant type.
But the layout of type v must be a sublayout of void, because
of the annotation on the declaration of the type v.
Expand All @@ -145,7 +145,7 @@ type attr : void = ..
Line 1, characters 0-21:
1 | type attr : void = ..
^^^^^^^^^^^^^^^^^^^^^
Error: The layout of type attr is non_null_value, because
Error: The layout of type attr is value, because
it's an extensible variant type.
But the layout of type attr must be a sublayout of void, because
of the annotation on the declaration of the type attr.
Expand All @@ -159,8 +159,8 @@ Line 1, characters 40-45:
^^^^^
Error: This expression has type string but an expression was expected of type
('a : void)
The layout of string is non_null_value, because
it is the primitive non-null value type string.
The layout of string is value, because
it is the primitive value type string.
But the layout of string must be a sublayout of void, because
of the annotation on the type variable 'a.
|}];;
Expand All @@ -187,7 +187,7 @@ Line 1, characters 40-45:
^^^^^
Error: This expression has type 'b * 'c
but an expression was expected of type ('a : void)
The layout of 'a * 'b is non_null_value, because
The layout of 'a * 'b is value, because
it's a tuple type.
But the layout of 'a * 'b must be a sublayout of void, because
of the annotation on the type variable 'a.
Expand All @@ -206,7 +206,7 @@ Line 2, characters 36-37:
^
Error: This expression has type [ `A of int | `B ]
but an expression was expected of type 'a t = ('a : void)
The layout of [ `A of int | `B ] is non_null_value, because
The layout of [ `A of int | `B ] is value, because
it's a polymorphic variant type.
But the layout of [ `A of int | `B ] must be a sublayout of void, because
of the definition of t at line 1, characters 0-22.
Expand All @@ -222,7 +222,7 @@ Line 2, characters 31-32:
^
Error: This expression has type int -> int
but an expression was expected of type 'a t = ('a : void)
The layout of int -> int is non_null_value, because
The layout of int -> int is value, because
it's a function type.
But the layout of int -> int must be a sublayout of void, because
of the definition of t at line 1, characters 0-22.
Expand All @@ -248,7 +248,7 @@ Line 4, characters 17-39:
^^^^^^^^^^^^^^^^^^^^^^
Error: This expression has type (module X_int)
but an expression was expected of type 'a t = ('a : void)
The layout of (module X_int) is non_null_value, because
The layout of (module X_int) is value, because
it's a first-class module type.
But the layout of (module X_int) must be a sublayout of void, because
of the definition of t at line 1, characters 0-22.
Expand Down
173 changes: 0 additions & 173 deletions testsuite/tests/typing-layouts-non-null-value/arguments.ml

This file was deleted.

Loading

0 comments on commit 49c625c

Please sign in to comment.