walkmod-core icon indicating copy to clipboard operation
walkmod-core copied to clipboard

CompilationUnit.removeChild() calls Node.updateReferences() with a boolean instead of the child object

Open vladislav-knoll opened this issue 5 years ago • 0 comments

When removing a child of a CompilationUnit (e.g. an ImportDeclaration), the CompilationUnit passes the result of List.remove() to Node.updateReferences(); see below.

boolean result = false;
...
if (result) {
  updateReferences(result);
}

Node.updateReferences() checks whether the argument is either a SymbolReference or a SymbolDefinition and updates the usages accordingly. For ImportDeclarations which implement SymbolDefinition this does not work as expected

vladislav-knoll avatar Oct 29 '19 13:10 vladislav-knoll