Skip to content

Commit 49c625c

Browse files
flambda-backend: Revert non-null PRs (#2658)
* Revert "Unboxed records may be null (#2648)" This reverts commit 771f0bc. * Revert "Define `'a or_null` (#2614)" This reverts commit c73c6fc. * Revert "Make various primitives `non_null_value` (#2604)" This reverts commit fd39aec. --------- Co-authored-by: Diana Kalinichenko <[email protected]>
1 parent 53831cf commit 49c625c

File tree

25 files changed

+457
-1790
lines changed

25 files changed

+457
-1790
lines changed

otherlibs/alpha/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
(rule
4040
(deps
4141
(glob_files ../stdlib_alpha/*.{ml,mli}))
42-
(targets alpha.ml alpha.mli or_null.ml or_null.mli)
42+
(targets alpha.ml alpha.mli)
4343
(action
4444
(bash
4545
"cp ../stdlib_alpha/*.{ml,mli} .; mv stdlib_alpha.ml alpha.ml; mv stdlib_alpha.mli alpha.mli")))

otherlibs/stdlib_alpha/or_null.ml

Lines changed: 0 additions & 17 deletions
This file was deleted.

otherlibs/stdlib_alpha/or_null.mli

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
module Or_null = Or_null
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
module Or_null = Or_null

testsuite/tests/ppx-empty-cases/test.compilers.reference

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,35 @@
33
(empty_cases_returning_string/269 =
44
(function {nlocal = 0} param/271
55
(raise
6-
(makeblock 0 (getpredef Match_failure/33!!) [0: "test.ml" 28 50])))
6+
(makeblock 0 (getpredef Match_failure/32!!) [0: "test.ml" 28 50])))
77
empty_cases_returning_float64/272 =
88
(function {nlocal = 0} param/274 : unboxed_float
99
(raise
10-
(makeblock 0 (getpredef Match_failure/33!!) [0: "test.ml" 29 50])))
10+
(makeblock 0 (getpredef Match_failure/32!!) [0: "test.ml" 29 50])))
1111
empty_cases_accepting_string/275 =
1212
(function {nlocal = 0} param/277
1313
(raise
14-
(makeblock 0 (getpredef Match_failure/33!!) [0: "test.ml" 30 50])))
14+
(makeblock 0 (getpredef Match_failure/32!!) [0: "test.ml" 30 50])))
1515
empty_cases_accepting_float64/278 =
1616
(function {nlocal = 0} param/280[unboxed_float]
1717
(raise
18-
(makeblock 0 (getpredef Match_failure/33!!) [0: "test.ml" 31 50])))
18+
(makeblock 0 (getpredef Match_failure/32!!) [0: "test.ml" 31 50])))
1919
non_empty_cases_returning_string/281 =
2020
(function {nlocal = 0} param/283
2121
(raise
22-
(makeblock 0 (getpredef Assert_failure/43!!) [0: "test.ml" 32 68])))
22+
(makeblock 0 (getpredef Assert_failure/42!!) [0: "test.ml" 32 68])))
2323
non_empty_cases_returning_float64/284 =
2424
(function {nlocal = 0} param/286 : unboxed_float
2525
(raise
26-
(makeblock 0 (getpredef Assert_failure/43!!) [0: "test.ml" 33 68])))
26+
(makeblock 0 (getpredef Assert_failure/42!!) [0: "test.ml" 33 68])))
2727
non_empty_cases_accepting_string/287 =
2828
(function {nlocal = 0} param/289
2929
(raise
30-
(makeblock 0 (getpredef Assert_failure/43!!) [0: "test.ml" 34 68])))
30+
(makeblock 0 (getpredef Assert_failure/42!!) [0: "test.ml" 34 68])))
3131
non_empty_cases_accepting_float64/290 =
3232
(function {nlocal = 0} param/292[unboxed_float]
3333
(raise
34-
(makeblock 0 (getpredef Assert_failure/43!!) [0: "test.ml" 35 68]))))
34+
(makeblock 0 (getpredef Assert_failure/42!!) [0: "test.ml" 35 68]))))
3535
(makeblock 0 empty_cases_returning_string/269
3636
empty_cases_returning_float64/272 empty_cases_accepting_string/275
3737
empty_cases_accepting_float64/278 non_empty_cases_returning_string/281

testsuite/tests/typing-layouts-err-msg/annots.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Line 1, characters 9-33:
9090
^^^^^^^^^^^^^^^^^^^^^^^^
9191
Error: This alias is bound to type 'a -> int
9292
but is used as an instance of type ('b : void)
93-
The layout of 'a -> int is non_null_value, because
93+
The layout of 'a -> int is value, because
9494
it's a function type.
9595
But the layout of 'a -> int must be a sublayout of void, because
9696
of the annotation on the type variable 'b.
@@ -104,7 +104,7 @@ Line 1, characters 27-31:
104104
1 | type t = 'a -> int as (_ : void)
105105
^^^^
106106
Error: Bad layout annotation:
107-
The layout of 'a -> int is non_null_value, because
107+
The layout of 'a -> int is value, because
108108
it's a function type.
109109
But the layout of 'a -> int must be a sublayout of void, because
110110
of the annotation on the wildcard _ at line 1, characters 27-31.

testsuite/tests/typing-layouts-err-msg/value.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ type r : void = {a:string}
121121
Line 1, characters 0-26:
122122
1 | type r : void = {a:string}
123123
^^^^^^^^^^^^^^^^^^^^^^^^^^
124-
Error: The layout of type r is non_null_value, because
124+
Error: The layout of type r is value, because
125125
it's a boxed record type.
126126
But the layout of type r must be a sublayout of void, because
127127
of the annotation on the declaration of the type r.
@@ -133,7 +133,7 @@ type v : void = A of t_value
133133
Line 1, characters 0-28:
134134
1 | type v : void = A of t_value
135135
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136-
Error: The layout of type v is non_null_value, because
136+
Error: The layout of type v is value, because
137137
it's a boxed variant type.
138138
But the layout of type v must be a sublayout of void, because
139139
of the annotation on the declaration of the type v.
@@ -145,7 +145,7 @@ type attr : void = ..
145145
Line 1, characters 0-21:
146146
1 | type attr : void = ..
147147
^^^^^^^^^^^^^^^^^^^^^
148-
Error: The layout of type attr is non_null_value, because
148+
Error: The layout of type attr is value, because
149149
it's an extensible variant type.
150150
But the layout of type attr must be a sublayout of void, because
151151
of the annotation on the declaration of the type attr.
@@ -159,8 +159,8 @@ Line 1, characters 40-45:
159159
^^^^^
160160
Error: This expression has type string but an expression was expected of type
161161
('a : void)
162-
The layout of string is non_null_value, because
163-
it is the primitive non-null value type string.
162+
The layout of string is value, because
163+
it is the primitive value type string.
164164
But the layout of string must be a sublayout of void, because
165165
of the annotation on the type variable 'a.
166166
|}];;
@@ -187,7 +187,7 @@ Line 1, characters 40-45:
187187
^^^^^
188188
Error: This expression has type 'b * 'c
189189
but an expression was expected of type ('a : void)
190-
The layout of 'a * 'b is non_null_value, because
190+
The layout of 'a * 'b is value, because
191191
it's a tuple type.
192192
But the layout of 'a * 'b must be a sublayout of void, because
193193
of the annotation on the type variable 'a.
@@ -206,7 +206,7 @@ Line 2, characters 36-37:
206206
^
207207
Error: This expression has type [ `A of int | `B ]
208208
but an expression was expected of type 'a t = ('a : void)
209-
The layout of [ `A of int | `B ] is non_null_value, because
209+
The layout of [ `A of int | `B ] is value, because
210210
it's a polymorphic variant type.
211211
But the layout of [ `A of int | `B ] must be a sublayout of void, because
212212
of the definition of t at line 1, characters 0-22.
@@ -222,7 +222,7 @@ Line 2, characters 31-32:
222222
^
223223
Error: This expression has type int -> int
224224
but an expression was expected of type 'a t = ('a : void)
225-
The layout of int -> int is non_null_value, because
225+
The layout of int -> int is value, because
226226
it's a function type.
227227
But the layout of int -> int must be a sublayout of void, because
228228
of the definition of t at line 1, characters 0-22.
@@ -248,7 +248,7 @@ Line 4, characters 17-39:
248248
^^^^^^^^^^^^^^^^^^^^^^
249249
Error: This expression has type (module X_int)
250250
but an expression was expected of type 'a t = ('a : void)
251-
The layout of (module X_int) is non_null_value, because
251+
The layout of (module X_int) is value, because
252252
it's a first-class module type.
253253
But the layout of (module X_int) must be a sublayout of void, because
254254
of the definition of t at line 1, characters 0-22.

testsuite/tests/typing-layouts-non-null-value/arguments.ml

Lines changed: 0 additions & 173 deletions
This file was deleted.

0 commit comments

Comments
 (0)