Prevent local constant default value from incorrect override by a global

This commit is contained in:
Yuri Roubinsky 2021-09-19 22:51:14 +03:00
parent a24e870c71
commit 05331a5bb9
1 changed files with 3 additions and 0 deletions

View File

@ -781,6 +781,9 @@ static void _find_identifiers_in_class(const GDScriptParser::ClassNode *p_class,
if (p_only_functions) { if (p_only_functions) {
continue; continue;
} }
if (r_result.has(member.constant->identifier->name)) {
continue;
}
option = ScriptCodeCompletionOption(member.constant->identifier->name, ScriptCodeCompletionOption::KIND_CONSTANT); option = ScriptCodeCompletionOption(member.constant->identifier->name, ScriptCodeCompletionOption::KIND_CONSTANT);
if (member.constant->initializer) { if (member.constant->initializer) {
option.default_value = member.constant->initializer->reduced_value; option.default_value = member.constant->initializer->reduced_value;