You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Merge pull request #83257 from dalexeev/gds-fix-unresolved-type-for-incomplete-expressions
GDScript: Fix unresolved datatype for incomplete expressions
This commit is contained in:
@@ -2500,6 +2500,14 @@ void GDScriptAnalyzer::reduce_expression(GDScriptParser::ExpressionNode *p_expre
|
|||||||
case GDScriptParser::Node::WHILE:
|
case GDScriptParser::Node::WHILE:
|
||||||
ERR_FAIL_MSG("Reaching unreachable case");
|
ERR_FAIL_MSG("Reaching unreachable case");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p_expression->get_datatype().kind == GDScriptParser::DataType::UNRESOLVED) {
|
||||||
|
// Prevent `is_type_compatible()` errors for incomplete expressions.
|
||||||
|
// The error can still occur if `reduce_*()` is called directly.
|
||||||
|
GDScriptParser::DataType dummy;
|
||||||
|
dummy.kind = GDScriptParser::DataType::VARIANT;
|
||||||
|
p_expression->set_datatype(dummy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GDScriptAnalyzer::reduce_array(GDScriptParser::ArrayNode *p_array) {
|
void GDScriptAnalyzer::reduce_array(GDScriptParser::ArrayNode *p_array) {
|
||||||
@@ -2802,9 +2810,6 @@ void GDScriptAnalyzer::reduce_binary_op(GDScriptParser::BinaryOpNode *p_binary_o
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!left_type.is_set() || !right_type.is_set()) {
|
if (!left_type.is_set() || !right_type.is_set()) {
|
||||||
GDScriptParser::DataType dummy;
|
|
||||||
dummy.kind = GDScriptParser::DataType::VARIANT;
|
|
||||||
p_binary_op->set_datatype(dummy);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user