Skip to content

Commit

Permalink
Adopting the child before grandchildren are adopted (in insert(child)).
Browse files Browse the repository at this point in the history
  • Loading branch information
iamstolis committed Jun 13, 2023
1 parent 08e63dd commit 5cf4571
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -223,6 +223,10 @@ public final <T extends Node> T[] insert(final T[] newChildren) {
public final <T extends Node> T insert(final T newChild) {
CompilerDirectives.transferToInterpreterAndInvalidate();
if (newChild != null) {
// TODO GR-46607 consider removing after GR-46607 is fixed.
if (newChild.isAdoptable()) {
((Node) newChild).parent = this;
}
adoptHelper(newChild);
assert checkSameLanguages(newChild) && newChild.checkSameLanguageOfChildren();
}

0 comments on commit 5cf4571

Please sign in to comment.