mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-01 06:01:14 +00:00 
			
		
		
		
	GDScript: Fix warning ignoring for member variables
This commit is contained in:
		
							parent
							
								
									20ed51a912
								
							
						
					
					
						commit
						c2fbb40e9a
					
				
					 3 changed files with 23 additions and 3 deletions
				
			
		|  | @ -1336,10 +1336,11 @@ void GDScriptAnalyzer::resolve_class_body(GDScriptParser::ClassNode *p_class, co | ||||||
| 						push_error(vformat(R"(Getter with type "%s" cannot be used along with setter of type "%s".)", getter_function->datatype.to_string(), setter_function->parameters[0]->datatype.to_string()), member.variable); | 						push_error(vformat(R"(Getter with type "%s" cannot be used along with setter of type "%s".)", getter_function->datatype.to_string(), setter_function->parameters[0]->datatype.to_string()), member.variable); | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| #ifdef DEBUG_ENABLED |  | ||||||
| 				parser->ignored_warnings = previously_ignored_warnings; |  | ||||||
| #endif // DEBUG_ENABLED
 |  | ||||||
| 			} | 			} | ||||||
|  | 
 | ||||||
|  | #ifdef DEBUG_ENABLED | ||||||
|  | 			parser->ignored_warnings = previously_ignored_warnings; | ||||||
|  | #endif // DEBUG_ENABLED
 | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,10 @@ | ||||||
|  | # GH-72135 | ||||||
|  | 
 | ||||||
|  | var _a | ||||||
|  | @warning_ignore("unused_private_class_variable") | ||||||
|  | var _b | ||||||
|  | @warning_ignore("unused_private_class_variable") var _c | ||||||
|  | var _d | ||||||
|  | 
 | ||||||
|  | func test(): | ||||||
|  | 	pass | ||||||
|  | @ -0,0 +1,9 @@ | ||||||
|  | GDTEST_OK | ||||||
|  | >> WARNING | ||||||
|  | >> Line: 3 | ||||||
|  | >> UNUSED_PRIVATE_CLASS_VARIABLE | ||||||
|  | >> The class variable "_a" is declared but never used in the script. | ||||||
|  | >> WARNING | ||||||
|  | >> Line: 7 | ||||||
|  | >> UNUSED_PRIVATE_CLASS_VARIABLE | ||||||
|  | >> The class variable "_d" is declared but never used in the script. | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Danil Alexeev
						Danil Alexeev