Skip to content

Commit d4cd5c0

Browse files
Tianhan Lumeta-codesync[bot]
authored andcommitted
Use property targets when resolving higher order parameters
Reviewed By: arthaud Differential Revision: D85466951 fbshipit-source-id: ec309513c699a06eaaf796dc3c5ff23b9198e675
1 parent 63c2089 commit d4cd5c0

File tree

3 files changed

+151
-354
lines changed

3 files changed

+151
-354
lines changed

pyrefly/lib/report/pysa/ast_visitor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use dupe::Dupe;
99
use pyrefly_python::module_name::ModuleName;
1010
use pyrefly_python::short_identifier::ShortIdentifier;
1111
use pyrefly_types::class::Class;
12+
use ruff_python_ast::Decorator;
1213
use ruff_python_ast::Expr;
1314
use ruff_python_ast::ModModule;
1415
use ruff_python_ast::Stmt;
@@ -345,7 +346,7 @@ fn visit_statement<V: AstScopedVisitor>(
345346
}
346347
fn visit_annotation(&mut self, expr: &'e Expr) {
347348
if V::visit_type_annotations() {
348-
self.visit_expr(expr);
349+
ruff_python_ast::visitor::source_order::walk_annotation(self, expr);
349350
}
350351
}
351352
}

pyrefly/lib/report/pysa/call_graph.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,9 +1328,15 @@ impl<'a> CallGraphVisitor<'a> {
13281328
ExpressionCallees::Call(callees) => {
13291329
(callees.call_targets, callees.unresolved)
13301330
}
1331-
ExpressionCallees::AttributeAccess(callees) => {
1332-
(callees.if_called.call_targets, callees.if_called.unresolved)
1333-
}
1331+
ExpressionCallees::AttributeAccess(callees) => (
1332+
[
1333+
callees.if_called.call_targets,
1334+
callees.property_getters,
1335+
callees.property_setters,
1336+
]
1337+
.concat(),
1338+
callees.if_called.unresolved,
1339+
),
13341340
ExpressionCallees::Identifier(callees) => {
13351341
(callees.if_called.call_targets, callees.if_called.unresolved)
13361342
}

0 commit comments

Comments
 (0)