Skip to content

Commit 62f24f5

Browse files
committed
Fix parse_type()
1 parent 4213a9d commit 62f24f5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/gdscript/gdscript_parser.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3975,27 +3975,26 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_invalid_token(ExpressionNo
39753975

39763976
GDScriptParser::TypeNode *GDScriptParser::parse_type(bool p_allow_void) {
39773977
TypeNode *type = alloc_node<TypeNode>();
3978-
refactor_rename_register(p_allow_void
3979-
? REFACTOR_RENAME_TYPE_TYPE_NAME_OR_VOID
3980-
: REFACTOR_RENAME_TYPE_TYPE_NAME,
3981-
type);
39823978
make_completion_context(p_allow_void ? COMPLETION_TYPE_NAME_OR_VOID : COMPLETION_TYPE_NAME, type);
39833979

39843980
if (!match(GDScriptTokenizer::Token::IDENTIFIER)) {
39853981
if (match(GDScriptTokenizer::Token::TK_VOID)) {
39863982
if (p_allow_void) {
39873983
complete_extents(type);
39883984
TypeNode *void_type = type;
3985+
refactor_rename_register(REFACTOR_RENAME_TYPE_TYPE_NAME_OR_VOID, type);
39893986
return void_type;
39903987
} else {
39913988
push_error(R"("void" is only allowed for a function return type.)");
39923989
}
39933990
}
39943991
// Leave error message to the caller who knows the context.
39953992
complete_extents(type);
3993+
refactor_rename_register(p_allow_void ? REFACTOR_RENAME_TYPE_TYPE_NAME_OR_VOID : REFACTOR_RENAME_TYPE_TYPE_NAME, type);
39963994
return nullptr;
39973995
}
39983996

3997+
refactor_rename_register(p_allow_void ? REFACTOR_RENAME_TYPE_TYPE_NAME_OR_VOID : REFACTOR_RENAME_TYPE_TYPE_NAME, type);
39993998
IdentifierNode *type_element = parse_identifier();
40003999

40014000
type->type_chain.push_back(type_element);

0 commit comments

Comments
 (0)