Skip to content

Commit

Permalink
Refine capture analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-blaeser committed Nov 30, 2024
1 parent 913acb8 commit 09f80e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mo_frontend/typing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ and infer_exp'' env exp : T.typ =
leave_scope env'' ve2 initial_usage;
assert(!closure = None);
closure := stable_function_closure env'' named_scope;
env.captured := !(env''.captured);
env.captured := S.union !(env''.captured) !(env'.captured);
(match !closure with
| Some Type.{ captured_variables; _ } ->
T.Env.iter (fun id typ ->
Expand Down Expand Up @@ -2836,7 +2836,7 @@ and infer_dec env dec : T.typ =
let t' = infer_obj { env''' with check_unused = true } obj_sort.it dec_fields dec.at in
leave_scope env''' ve initial_usage;
closure := stable_function_closure env''' named_scope; (* stable class constructor, e.g. in nested classes *)
env.captured := !(env''.captured);
env.captured := S.union !(env'''.captured) !(env'.captured);
match typ_opt, obj_sort.it with
| None, _ -> ()
| Some { it = AsyncT (T.Fut, _, typ); at; _ }, T.Actor
Expand Down

0 comments on commit 09f80e9

Please sign in to comment.