Skip to content

Move mixed blocks from layouts_alpha to layouts_beta #2542

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

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/mixed-blocks/constructor_args.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* TEST
flags = "-extension layouts_alpha";
flags = "-extension layouts_beta";
flambda2;
{
native;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ let main n ~bytecode =
List.iter2 values (List.tl values @ [ List.hd values]) ~f
in
line {|(* TEST
flags = "-extension layouts_alpha";|};
flags = "-extension layouts_beta";|};
if bytecode then (
line {| bytecode;|};
) else (
Expand Down
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/mixed-blocks/generated_byte_test.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* TEST
flags = "-extension layouts_alpha";
flags = "-extension layouts_beta";
bytecode;
*)
(** This is code generated by [generate_mixed_blocks_code.ml]. *)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* TEST
flags = "-extension layouts_alpha";
flags = "-extension layouts_beta";
flambda2;
native;
*)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/mixed-blocks/hash.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* TEST
flags = "-extension layouts_alpha";
flags = "-extension layouts_beta";
flambda2;
{
native;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* TEST
flags = "-extension layouts_alpha";
flags = "-extension layouts_beta";
flambda2;
{
native;
Expand Down
4 changes: 2 additions & 2 deletions ocaml/testsuite/tests/mixed-blocks/test_mixed_blocks.ml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(* TEST
flambda2;
{
flags = "-extension layouts_alpha";
flags = "-extension layouts_beta";
native;
}{
flags = "-extension layouts_alpha";
flags = "-extension layouts_beta";
bytecode;
}
*)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/mixed-blocks/test_printing.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* TEST
flags = "-extension layouts_alpha";
flags = "-extension layouts_beta";
expect;
*)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* TEST
flags = "-extension layouts_alpha";
flags = "-extension layouts_beta";
expect;
*)

Expand Down
97 changes: 0 additions & 97 deletions ocaml/testsuite/tests/typing-layouts-bits32/basics_alpha.ml

This file was deleted.

66 changes: 16 additions & 50 deletions ocaml/testsuite/tests/typing-layouts-bits32/basics_beta.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
(* TEST
flags = "-extension layouts_beta";
expect;
{
flags = "-extension layouts_alpha";
expect;
}{
flags = "-extension layouts_beta";
expect;
}
*)

(* We should move these back into [basics.ml] once
Expand All @@ -18,61 +23,34 @@ type ('a : bits32) t_bits32_id = 'a

type t5_1 = { x : t_bits32 };;
[%%expect{|
Line 1, characters 0-28:
1 | type t5_1 = { x : t_bits32 };;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: The enabled layouts extension does not allow for mixed records.
You must enable -extension layouts_alpha to use this feature.
type t5_1 = { x : t_bits32; }
|}];;

(* CR layouts v5: this should work *)
type t5_2 = { y : int; x : t_bits32 };;
[%%expect{|
Line 1, characters 0-37:
1 | type t5_2 = { y : int; x : t_bits32 };;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: The enabled layouts extension does not allow for mixed records.
You must enable -extension layouts_alpha to use this feature.
type t5_2 = { y : int; x : t_bits32; }
|}];;

(* CR layouts: this runs afoul of the mixed block restriction, but should work
once we relax that. *)
type t5_2' = { y : string; x : t_bits32 };;
[%%expect{|
Line 1, characters 0-41:
1 | type t5_2' = { y : string; x : t_bits32 };;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: The enabled layouts extension does not allow for mixed records.
You must enable -extension layouts_alpha to use this feature.
type t5_2' = { y : string; x : t_bits32; }
|}];;

type t5_4 = A of t_bits32;;
[%%expect{|
Line 1, characters 12-25:
1 | type t5_4 = A of t_bits32;;
^^^^^^^^^^^^^
Error: The enabled layouts extension does not allow for mixed constructors.
You must enable -extension layouts_alpha to use this feature.
type t5_4 = A of t_bits32
|}];;

type t5_5 = A of int * t_bits32;;
[%%expect{|
Line 1, characters 12-31:
1 | type t5_5 = A of int * t_bits32;;
^^^^^^^^^^^^^^^^^^^
Error: The enabled layouts extension does not allow for mixed constructors.
You must enable -extension layouts_alpha to use this feature.
type t5_5 = A of int * t_bits32
|}];;

type ('a : bits32) t5_7 = A of int
type ('a : bits32) t5_8 = A of 'a;;
[%%expect{|
type ('a : bits32) t5_7 = A of int
Line 2, characters 26-33:
2 | type ('a : bits32) t5_8 = A of 'a;;
^^^^^^^
Error: The enabled layouts extension does not allow for mixed constructors.
You must enable -extension layouts_alpha to use this feature.
type ('a : bits32) t5_8 = A of 'a
|}]

(* not allowed: value in flat suffix *)
Expand All @@ -93,20 +71,12 @@ type t11_1 = ..
type t11_1 += A of t_bits32;;
[%%expect{|
type t11_1 = ..
Line 3, characters 14-27:
3 | type t11_1 += A of t_bits32;;
^^^^^^^^^^^^^
Error: The enabled layouts extension does not allow for mixed constructors.
You must enable -extension layouts_alpha to use this feature.
type t11_1 += A of t_bits32
|}]

type t11_1 += B of int32#;;
[%%expect{|
Line 1, characters 14-25:
1 | type t11_1 += B of int32#;;
^^^^^^^^^^^
Error: The enabled layouts extension does not allow for mixed constructors.
You must enable -extension layouts_alpha to use this feature.
type t11_1 += B of int32#
|}]

type ('a : bits32) t11_2 = ..
Expand All @@ -118,11 +88,7 @@ type 'a t11_2 += B of 'a;;
[%%expect{|
type ('a : bits32) t11_2 = ..
type 'a t11_2 += A of int
Line 5, characters 17-24:
5 | type 'a t11_2 += B of 'a;;
^^^^^^^
Error: The enabled layouts extension does not allow for mixed constructors.
You must enable -extension layouts_alpha to use this feature.
type 'a t11_2 += B of 'a
|}]

(* not allowed: value in flat suffix *)
Expand Down
4 changes: 2 additions & 2 deletions ocaml/testsuite/tests/typing-layouts-bits32/parsing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Line 1, characters 9-20:
1 | type t = C of int32#;;
^^^^^^^^^^^
Error: The enabled layouts extension does not allow for mixed constructors.
You must enable -extension layouts_alpha to use this feature.
You must enable -extension layouts_beta to use this feature.
|}];;

type t = C : int32# -> t;;
Expand All @@ -29,7 +29,7 @@ Line 1, characters 9-24:
1 | type t = C : int32# -> t;;
^^^^^^^^^^^^^^^
Error: The enabled layouts extension does not allow for mixed constructors.
You must enable -extension layouts_alpha to use this feature.
You must enable -extension layouts_beta to use this feature.
|}];;

(* int32# works as an argument to normal type constructors, not just
Expand Down
Loading
Loading