Skip to content

AssertionError thrown by Var.class : setParentNode(QueryModelNode parent) during the execution of Visitor/Inference-related Unit Tests #4901

Answered by hmottestad
ABLEquitus asked this question in Q&A
Discussion options

You must be logged in to vote

We've had issues in the code with the parent pointer of the query tree nodes not pointing to the correct parent because nodes have been shared between multiple other nodes. To help mitigate this we have made the Var node parent pointer essentially immutable once it's been set to force us to always mint a new Var object instead of reusing an existing one. This doesn't apply to other nodes, since it's useful to be able to manipulate the query tree without having to rebuild every subtree for each operation.

I would look through your stack trace and check which of your methods are reusing an existing Var node when creating the StatementPattern.

A quick fix is typically to clone the Var node. …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ABLEquitus
Comment options

Answer selected by ABLEquitus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants