File tree 2 files changed +10
-4
lines changed
testsuite/tests/typing-unique
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ let disallowed_by_regionality (local_ unique_ r) x =
176
176
Line 3 , characters 16-17 :
177
177
3 | let ref = ref r in
178
178
^
179
- Error : This value is " yielding " but expected to be " unyielding " .
179
+ Error : This value escapes its region .
180
180
| }]
181
181
182
182
let gc_soundness_no_bug (unique_ r ) x =
Original file line number Diff line number Diff line change @@ -6840,13 +6840,19 @@ and type_expect_
6840
6840
mk_expected (newvar (Jkind.Builtin. value ~why: Boxed_record ))
6841
6841
in
6842
6842
let exp1 = type_expect ~recarg env (mode_default cell_mode) exp1 cell_type in
6843
- let exp2 =
6843
+ let new_fields_mode =
6844
6844
(* The newly-written fields have to be global to avoid heap-to-stack pointers.
6845
6845
We enforce that here, by asking the allocation to be global.
6846
6846
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 =
6847
6853
let exp2_mode =
6848
6854
mode_coerce
6849
- (Value. max_with ( Comonadic Areality ) Regionality. global )
6855
+ (Value. (meet_const new_fields_mode max |> disallow_left) )
6850
6856
expected_mode
6851
6857
in
6852
6858
(* When typing holes, we will enforce: fields_mode <= expected_mode.
@@ -6857,7 +6863,7 @@ and type_expect_
6857
6863
And we have also checked above that for regionality cell_mode <= expected_mode.
6858
6864
Therefore, we can safely ignore regionality when checking the mode of holes. *)
6859
6865
let fields_mode =
6860
- Value. meet_with ( Comonadic Areality ) Regionality.Const. Global cell_mode
6866
+ Value. meet_const new_fields_mode cell_mode
6861
6867
|> Value. disallow_right
6862
6868
in
6863
6869
let overwrite =
You can’t perform that action at this time.
0 commit comments