"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "interprocedural/callResolution.ml" between
pyre-check-0.0.53.tar.gz and pyre-check-0.0.54.tar.gz

About: Pyre is a performant type checker for Python (ships with Pysa, a security focused static analysis tool).

callResolution.ml  (pyre-check-0.0.53):callResolution.ml  (pyre-check-0.0.54)
skipping to change at line 336 skipping to change at line 336
| `Method { Callable.class_name; method_name } -> | `Method { Callable.class_name; method_name } ->
`Method { Callable.class_name; method_name = method_name ^ "$set ter" } `Method { Callable.class_name; method_name = method_name ^ "$set ter" }
| _ -> target | _ -> target
in in
target, implicit target, implicit
in in
List.map targets ~f:to_setter |> Option.some List.map targets ~f:to_setter |> Option.some
else else
Some targets Some targets
let resolve_call_targets ~resolution call =
let { Call.callee; _ } = Analysis.Annotated.Call.redirect_special_calls ~resol
ution call in
match Node.value callee with
| Name (Name.Attribute { base; _ }) ->
let receiver_type = resolve_ignoring_optional ~resolution base in
resolve_target ~resolution ~receiver_type callee
| Name (Name.Identifier name) when not (String.equal name "super") ->
let receiver_type = resolve_ignoring_optional ~resolution callee in
if Type.is_meta receiver_type then
let callee =
Expression.Name
(Name.Attribute { base = callee; attribute = "__init__"; special = f
alse })
|> Node.create_with_default_location
in
resolve_target ~resolution ~receiver_type callee
else
resolve_target ~resolution callee
| _ -> resolve_target ~resolution callee
type target = Callable.t * Type.t option [@@deriving show, eq] type target = Callable.t * Type.t option [@@deriving show, eq]
type constructor_targets = { type constructor_targets = {
new_targets: target list; new_targets: target list;
init_targets: target list; init_targets: target list;
} }
let get_constructor_targets ~resolution ~receiver = let get_constructor_targets ~resolution ~receiver =
let new_targets = let new_targets =
let targets, _ = get_indirect_targets ~resolution ~receiver ~method_name:"__ new__" in let targets, _ = get_indirect_targets ~resolution ~receiver ~method_name:"__ new__" in
 End of changes. 1 change blocks. 
21 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)