Skip to content

Commit b1e1832

Browse files
committed
dirty fix test change
1 parent 00ad634 commit b1e1832

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

testsuite/tests/typing-unique/overwriting.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ let disallowed_by_regionality (local_ unique_ r) x =
176176
Line 3, characters 16-17:
177177
3 | let ref = ref r in
178178
^
179-
Error: This value is "yielding" but expected to be "unyielding".
179+
Error: This value escapes its region.
180180
|}]
181181

182182
let gc_soundness_no_bug (unique_ r) x =

typing/typecore.ml

+9-3
Original file line numberDiff line numberDiff line change
@@ -6840,13 +6840,19 @@ and type_expect_
68406840
mk_expected (newvar (Jkind.Builtin.value ~why:Boxed_record))
68416841
in
68426842
let exp1 = type_expect ~recarg env (mode_default cell_mode) exp1 cell_type in
6843-
let exp2 =
6843+
let new_fields_mode =
68446844
(* The newly-written fields have to be global to avoid heap-to-stack pointers.
68456845
We enforce that here, by asking the allocation to be global.
68466846
This makes the block alloc_heap, but we ignore that information anyway. *)
6847+
(* CR uniqueness: this shouldn't mention yielding *)
6848+
{ Value.Const.max with
6849+
areality = Regionality.Const.Global
6850+
; yielding = Yielding.Const.Unyielding }
6851+
in
6852+
let exp2 =
68476853
let exp2_mode =
68486854
mode_coerce
6849-
(Value.max_with (Comonadic Areality) Regionality.global)
6855+
(Value.(meet_const new_fields_mode max |> disallow_left))
68506856
expected_mode
68516857
in
68526858
(* When typing holes, we will enforce: fields_mode <= expected_mode.
@@ -6857,7 +6863,7 @@ and type_expect_
68576863
And we have also checked above that for regionality cell_mode <= expected_mode.
68586864
Therefore, we can safely ignore regionality when checking the mode of holes. *)
68596865
let fields_mode =
6860-
Value.meet_with (Comonadic Areality) Regionality.Const.Global cell_mode
6866+
Value.meet_const new_fields_mode cell_mode
68616867
|> Value.disallow_right
68626868
in
68636869
let overwrite =

0 commit comments

Comments
 (0)