Skip to content

Commit 5701916

Browse files
committed
Pull and apply latest changes from upstream
1 parent 874de7e commit 5701916

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

src/ocaml/typing/ctype.ml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,23 @@ let create_scope () =
209209
level
210210

211211
let wrap_end_def f = Misc.try_finally f ~always:end_def
212-
let wrap_end_def_new_pool f =
213-
wrap_end_def (fun _ -> with_new_pool ~level:!current_level f)
214212

215213
(* [with_local_level_gen] handles both the scoping structure of levels
216214
and automatic generalization through pools (cf. btype.ml) *)
217215
let with_local_level_gen ~begin_def ~structure ?before_generalize f =
218216
begin_def ();
219217
let level = !current_level in
220-
let result, pool = wrap_end_def_new_pool f in
221-
Option.iter (fun g -> g result) before_generalize;
218+
let result, pool =
219+
with_new_pool ~level:!current_level begin fun () ->
220+
let result = wrap_end_def f in
221+
Option.iter (fun g -> g result) before_generalize;
222+
result
223+
end
224+
in
222225
simple_abbrevs := Mnil;
223-
(* Nodes in [pool] were either created by the above call to [f],
224-
or they were created before, generalized, and then added to
225-
the pool by [update_level].
226+
(* Nodes in [pool] were either created by the above calls to [f]
227+
and [before_generalize], or they were created before, generalized,
228+
and then added to the pool by [update_level].
226229
In the latter case, their level was already kept for backtracking
227230
by a call to [set_level] inside [update_level].
228231
Since backtracking can only go back to a snapshot taken before [f] was

upstream/ocaml_503/base-rev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
630a342bf2b033a1be1c8746cbd34d0c63801ded
1+
bc5083c1d3b773fc3198355494afd2fb4628ff0e

upstream/ocaml_503/typing/ctype.ml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,20 +192,23 @@ let create_scope () =
192192
level
193193

194194
let wrap_end_def f = Misc.try_finally f ~always:end_def
195-
let wrap_end_def_new_pool f =
196-
wrap_end_def (fun _ -> with_new_pool ~level:!current_level f)
197195

198196
(* [with_local_level_gen] handles both the scoping structure of levels
199197
and automatic generalization through pools (cf. btype.ml) *)
200198
let with_local_level_gen ~begin_def ~structure ?before_generalize f =
201199
begin_def ();
202200
let level = !current_level in
203-
let result, pool = wrap_end_def_new_pool f in
204-
Option.iter (fun g -> g result) before_generalize;
201+
let result, pool =
202+
with_new_pool ~level:!current_level begin fun () ->
203+
let result = wrap_end_def f in
204+
Option.iter (fun g -> g result) before_generalize;
205+
result
206+
end
207+
in
205208
simple_abbrevs := Mnil;
206-
(* Nodes in [pool] were either created by the above call to [f],
207-
or they were created before, generalized, and then added to
208-
the pool by [update_level].
209+
(* Nodes in [pool] were either created by the above calls to [f]
210+
and [before_generalize], or they were created before, generalized,
211+
and then added to the pool by [update_level].
209212
In the latter case, their level was already kept for backtracking
210213
by a call to [set_level] inside [update_level].
211214
Since backtracking can only go back to a snapshot taken before [f] was

0 commit comments

Comments
 (0)