Skip to content

Commit

Permalink
[flow] Ignore the content of exact_reason in Slice_utils.mk_object
Browse files Browse the repository at this point in the history
Summary:
As the effort to replace `ExactT` with EvalT-based implementation, I want to lock down all places where we construct `ExactT`. This is the final non-EvalT-like use case, and we still haven't completely figured out why it's necessary to preserve existing behavior and perf.

This diff aims to show that at least reason is not the reason this is critical, since we can ignore the reason content, since the last call site passes in a reason for `exact_reason` to be the same as the `def_reason`.

Building on this knowledge in the next diff, I will rename this param to avoid future confusion.

Changelog: [internal]

Reviewed By: gkz

Differential Revision: D56916901

fbshipit-source-id: 2c9002247282b50614962a17c42c2b460e7810b1
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed May 3, 2024
1 parent 96d3d39 commit 5f2a568
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/typing/slice_utils.ml
Expand Up @@ -48,15 +48,9 @@ let mk_object_type
let t = DefT (def_reason, ObjT (mk_objecttype ~reachable_targs ~flags ~call id proto)) in
(* Wrap the final type in an `ExactT` if we have an exact flag *)
Base.Option.value_map
~f:(fun exact_reason ->
~f:(fun _ ->
if Obj_type.is_exact flags.obj_kind then
let exact_reason =
if invalidate_aliases then
update_desc_reason invalidate_rtype_alias exact_reason
else
exact_reason
in
(ExactT (exact_reason, t), exact_reason)
(ExactT (def_reason, t), def_reason)
else
(t, def_reason))
~default:(t, def_reason)
Expand Down

0 comments on commit 5f2a568

Please sign in to comment.