File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
testsuite/tests/typing-layouts-arrays Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -254,3 +254,29 @@ Error: This expression has type ('a : float64)
254
254
But the layout of int32 # must be a sublayout of float64, because
255
255
of the definition of arr at line 6 , characters 12 -16.
256
256
| }]
257
+
258
+ (* ********************)
259
+ (* Test 7: rec check *)
260
+
261
+ (* See upstream PR #6939 *)
262
+
263
+ let _ =
264
+ let [@ warning " -10" ] rec x = [| x |]; #42.0 in
265
+ () ;;
266
+ [%% expect{|
267
+ Line 2 , characters 30-44 :
268
+ 2 | let [@ warning " -10" ] rec x = [| x |]; #42.0 in
269
+ ^^^^^^^^^^^^^^
270
+ Error : This kind of expression is not allowed as right- hand side of `let rec '
271
+ | }]
272
+
273
+ let _ =
274
+ let [@ warning " -10" ] rec x = [| x |]; #42L in
275
+ () ;;
276
+
277
+ [%% expect{|
278
+ Line 2 , characters 30-43 :
279
+ 2 | let [@ warning " -10" ] rec x = [| x |]; #42L in
280
+ ^^^^^^^^^^^^^
281
+ Error : This kind of expression is not allowed as right- hand side of `let rec '
282
+ | }]
Original file line number Diff line number Diff line change @@ -528,7 +528,7 @@ let array_mode exp elt_sort = match Typeopt.array_kind exp elt_sort with
528
528
(* non-generic, non-float arrays act as constructors *)
529
529
Guard
530
530
| Lambda. Punboxedfloatarray _ | Lambda. Punboxedintarray _ ->
531
- Guard
531
+ Dereference
532
532
533
533
(* Expression judgment:
534
534
G |- e : m
You can’t perform that action at this time.
0 commit comments