Skip to content

Commit

Permalink
Move the Reference.delocalize check
Browse files Browse the repository at this point in the history
Summary:
Moving this check since `Reference.is_global` contains a delocalize
```
let is_global { global_resolution; _ } ~reference =
  Reference.delocalize reference |> GlobalResolution.global global_resolution |> Option.is_some
```

We still want to delocalize the output since `is_builtin_reference` expects a delocalized variable.

Reviewed By: arthaud

Differential Revision: D50205910

fbshipit-source-id: 872fbf6a1e579eb82bd495ba9bb0e503d2ba708d
  • Loading branch information
alexkassil authored and facebook-github-bot committed Oct 14, 2023
1 parent 999cb5f commit 15c6d15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/interprocedural/callGraph.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,9 +1726,9 @@ let resolve_attribute_access_properties
let as_global_reference ~resolution expression =
match Node.value expression with
| Expression.Name (Name.Identifier identifier) ->
let reference = Reference.delocalize (Reference.create identifier) in
let reference = Reference.create identifier in
if Resolution.is_global resolution ~reference then
Some reference
Some (Reference.delocalize reference)
else
None
| Name name -> (
Expand Down

0 comments on commit 15c6d15

Please sign in to comment.