File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
crates/ty_python_semantic/src/semantic_index Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2697,6 +2697,12 @@ impl SemanticSyntaxContext for SemanticIndexBuilder<'_, '_> {
26972697 None
26982698 }
26992699
2700+ // We handle the one syntax error that relies on this method (`NonlocalWithoutBinding`) directly
2701+ // in `infer_nonlocal_statement`, so this just returns `true`.
2702+ fn has_nonlocal_binding ( & self , _name : & str ) -> bool {
2703+ true
2704+ }
2705+
27002706 fn in_async_context ( & self ) -> bool {
27012707 for scope_info in self . scope_stack . iter ( ) . rev ( ) {
27022708 let scope = & self . scopes [ scope_info. file_scope_id ] ;
@@ -2776,10 +2782,6 @@ impl SemanticSyntaxContext for SemanticIndexBuilder<'_, '_> {
27762782 )
27772783 }
27782784
2779- fn has_nonlocal_binding ( & self , _name : & str ) -> bool {
2780- true
2781- }
2782-
27832785 fn in_notebook ( & self ) -> bool {
27842786 self . source_text ( ) . is_notebook ( )
27852787 }
You can’t perform that action at this time.
0 commit comments