- marked as enhancement
- edited description
Abstract node types should declare fullCopy
Issue #42
resolved
Click here to view original trac ticket.
All non-abstract node types override ASTNode.fullCopy()
, and thus the following will compile clean:
A newA = getA().fullCopy();
However, for abstract node types it will need a cast, since the return type of fullCopy
will be the nearest non-abstract superclass.
I suggest that the following declaration is added to all abstract node types:
public abstract A fullCopy();
Where A is the name of the node type. This would mean that the return type of B.fullCopy()
would be B even if B is abstract.
Comments (2)
-
reporter -
reporter - changed status to resolved
This was implemented a while ago. Added regression test
tests/copy/fullCopy01
. - Log in to comment
Changed issue kind.