summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaracenOne <SaracenOne@gmail.com>2022-02-16 13:25:27 +0000
committerSaracenOne <SaracenOne@gmail.com>2022-02-16 13:25:27 +0000
commitd45c3cdd1db4ae6f3d30f87deb6c170a62fe4bcb (patch)
treed1a06b30421fee9dca88530753561e3e72ed75ae
parentb3507ab0cdf25e470b1e4d977ed0bea32a305c1b (diff)
Fix error when assigning to an explicitly annotated variant from an ambiguous source
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 94daba4bf6..87dfc33a3c 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -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;