Skip to content

Commit

Permalink
LibCpp: Fix parent of parameter type node
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
itamar8910 authored and awesomekling committed Feb 8, 2022
1 parent 36aac14 commit ae68355
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Userland/Libraries/LibCpp/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ Optional<NonnullRefPtrVector<Parameter>> Parser::parse_parameter_list(ASTNode& p
name = text_of_token(name_identifier.value());

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

param->set_type(move(type));
parameters.append(move(param));
Expand Down

0 comments on commit ae68355

Please sign in to comment.