File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
crates/ruff_python_parser/tests Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -593,9 +593,24 @@ impl Visitor<'_> for SemanticSyntaxCheckerVisitor<'_> {
593
593
fn visit_stmt ( & mut self , stmt : & ast:: Stmt ) {
594
594
self . with_semantic_checker ( |semantic, context| semantic. visit_stmt ( stmt, context) ) ;
595
595
match stmt {
596
- ast:: Stmt :: ClassDef ( _) => {
596
+ ast:: Stmt :: ClassDef ( ast:: StmtClassDef {
597
+ arguments,
598
+ body,
599
+ decorator_list,
600
+ type_params,
601
+ ..
602
+ } ) => {
603
+ for decorator in decorator_list {
604
+ self . visit_decorator ( decorator) ;
605
+ }
606
+ if let Some ( type_params) = type_params {
607
+ self . visit_type_params ( type_params) ;
608
+ }
609
+ if let Some ( arguments) = arguments {
610
+ self . visit_arguments ( arguments) ;
611
+ }
597
612
self . scopes . push ( Scope :: Class ) ;
598
- ast :: visitor :: walk_stmt ( self , stmt ) ;
613
+ self . visit_body ( body ) ;
599
614
self . scopes . pop ( ) . unwrap ( ) ;
600
615
}
601
616
ast:: Stmt :: FunctionDef ( ast:: StmtFunctionDef { is_async, .. } ) => {
You can’t perform that action at this time.
0 commit comments