Skip to content

Commit eb2facc

Browse files
only add ReturnsNever constraints in function scopes?
1 parent 253e269 commit eb2facc

File tree

1 file changed

+3
-1
lines changed
  • crates/ty_python_semantic/src/semantic_index

1 file changed

+3
-1
lines changed

crates/ty_python_semantic/src/semantic_index/builder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,9 @@ impl<'ast> Visitor<'ast> for SemanticIndexBuilder<'_, 'ast> {
22242224
}
22252225
walk_expr(self, expr);
22262226
}
2227-
ast::Expr::Call(ast::ExprCall { func, .. }) if !self.source_type.is_stub() => {
2227+
ast::Expr::Call(ast::ExprCall { func, .. })
2228+
if !self.source_type.is_stub() && self.in_function_scope() =>
2229+
{
22282230
let expression = self.add_standalone_expression(func);
22292231

22302232
let predicate = Predicate {

0 commit comments

Comments
 (0)