Skip to content

Commit 2e2593f

Browse files
authored
Layout history: mark typing-immediate/immediate.ml as reviewed (#2144)
mark test file as reviewed
1 parent 4f01a97 commit 2e2593f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

ocaml/testsuite/tests/typing-immediate/immediate.ml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(* TEST
22
* expect
33
*)
4-
(* CR layouts v2.9: all error messages below here are unreviewed *)
54

65
module type S = sig type t [@@immediate] end;;
76
module F (M : S) : S = M;;
@@ -149,6 +148,9 @@ Error: The layout of type string is value, because
149148
But the layout of type string must be a sublayout of immediate, because
150149
of the definition of t at line 2, characters 2-31.
151150
|}];;
151+
(* CR layouts v2.9: The "of the definition of t ..." part is not great and it
152+
should only refer to definitions that type check. Fixing it will involve
153+
building a second [final_env] in [transl_type_decl] which is costly. *)
152154

153155
(* Cannot directly declare a non-immediate type as immediate (variant) *)
154156
module B = struct
@@ -177,6 +179,8 @@ Error: The layout of type t is value, because
177179
But the layout of type t must be a sublayout of immediate, because
178180
of the annotation on the declaration of the type t/2.
179181
|}];;
182+
(* CR layouts v2.9: Investigate why the "/2" is here and check if it's only limited
183+
to expect tests. *)
180184

181185
(* Not guaranteed that t is immediate, so this is an invalid declaration *)
182186
module C = struct
@@ -219,7 +223,6 @@ Error: Signature mismatch:
219223

220224
(* Same as above but with explicit signature *)
221225
module M_invalid : S = struct type t = string end;;
222-
module FM_invalid = F (struct type t = string end);;
223226
[%%expect{|
224227
Line 1, characters 23-49:
225228
1 | module M_invalid : S = struct type t = string end;;
@@ -236,6 +239,23 @@ Error: Signature mismatch:
236239
of the definition of t at line 1, characters 20-40.
237240
|}];;
238241

242+
module FM_invalid = F (struct type t = string end);;
243+
[%%expect{|
244+
Line 1, characters 20-50:
245+
1 | module FM_invalid = F (struct type t = string end);;
246+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
247+
Error: Modules do not match: sig type t = string end is not included in
248+
S
249+
Type declarations do not match:
250+
type t = string
251+
is not included in
252+
type t : immediate
253+
The layout of the first is value, because
254+
it is the primitive value type string.
255+
But the layout of the first must be a sublayout of immediate, because
256+
of the definition of t at line 1, characters 20-40.
257+
|}];;
258+
239259
(* Can't use a non-immediate type even if mutually recursive *)
240260
module E = struct
241261
type t = s [@@immediate]

0 commit comments

Comments
 (0)