mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-03 23:21:15 +00:00 
			
		
		
		
	Allow non-constant string message for assert
This commit is contained in:
		
							parent
							
								
									ecc86afc00
								
							
						
					
					
						commit
						8035f1e36f
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1590,8 +1590,8 @@ void GDScriptAnalyzer::resolve_assert(GDScriptParser::AssertNode *p_assert) {
 | 
			
		|||
	reduce_expression(p_assert->condition);
 | 
			
		||||
	if (p_assert->message != nullptr) {
 | 
			
		||||
		reduce_expression(p_assert->message);
 | 
			
		||||
		if (!p_assert->message->is_constant || p_assert->message->reduced_value.get_type() != Variant::STRING) {
 | 
			
		||||
			push_error(R"(Expected constant string for assert error message.)", p_assert->message);
 | 
			
		||||
		if (!p_assert->message->get_datatype().has_no_type() && (p_assert->message->get_datatype().kind != GDScriptParser::DataType::BUILTIN || p_assert->message->get_datatype().builtin_type != Variant::STRING)) {
 | 
			
		||||
			push_error(R"(Expected string for assert error message.)", p_assert->message);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue