Skip to content

Commit ae68355

Browse files
itamar8910awesomekling
authored andcommitted
LibCpp: Fix parent of parameter type node
Previously, the parent of a parameter's Type node was incorrectly set to the parent of the Parameter node. We now set the parent of the parameter's Type node to the Parameter node itself.
1 parent 36aac14 commit ae68355

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Userland/Libraries/LibCpp/Parser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ Optional<NonnullRefPtrVector<Parameter>> Parser::parse_parameter_list(ASTNode& p
769769
name = text_of_token(name_identifier.value());
770770

771771
auto param = create_ast_node<Parameter>(parent, type->start(), name_identifier.has_value() ? name_identifier.value().end() : type->end(), name);
772+
type->set_parent(*param.ptr());
772773

773774
param->set_type(move(type));
774775
parameters.append(move(param));

0 commit comments

Comments
 (0)