summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDanil Alexeev <danil@alexeev.xyz>2022-11-10 19:22:52 +0300
committerDanil Alexeev <danil@alexeev.xyz>2022-11-10 19:22:52 +0300
commit0f8e28f818c6650a52c32a509180a09773e29835 (patch)
treee9f244f811f5a0f517a1bfff919c5992b18174f5 /modules
parentdca5cb8e40fd2a348a59ea73c597eb742c14c980 (diff)
GDScript 2.0: Fix shift due to skip of non-constant default argument values
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 704dda8045..5985891605 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -1163,6 +1163,8 @@ void GDScriptAnalyzer::resolve_function_signature(GDScriptParser::FunctionNode *
if (p_function->parameters[i]->default_value->is_constant) {
p_function->default_arg_values.push_back(p_function->parameters[i]->default_value->reduced_value);
+ } else {
+ p_function->default_arg_values.push_back(Variant()); // Prevent shift.
}
}
#endif // TOOLS_ENABLED