2
0
Fork 0

Fix error when assigning to an explicitly annotated variant from an ambiguous source

4.0
SaracenOne 2022-02-16 13:25:27 +07:00
parent b3507ab0cd
commit d45c3cdd1d
1 changed files with 1 additions and 1 deletions

@ -1414,7 +1414,7 @@ void GDScriptAnalyzer::resolve_variable(GDScriptParser::VariableNode *p_variable
parser->push_warning(p_variable->initializer, GDScriptWarning::NARROWING_CONVERSION);
#endif
}
if (p_variable->initializer->get_datatype().is_variant()) {
if (p_variable->initializer->get_datatype().is_variant() && !type.is_variant()) {
// TODO: Warn unsafe assign.
mark_node_unsafe(p_variable->initializer);
p_variable->use_conversion_assign = true;