You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem: astcopy functions do not copy ast.Object fields because some projects may not care about them at all (go/types.Object is better and deprecates ast.Object). But if for whatever reason user must copy objects, there will be troubles.
The problem: astcopy functions do not copy
ast.Object
fields because some projects may not care about them at all (go/types.Object
is better and deprecatesast.Object
). But if for whatever reason user must copy objects, there will be troubles.I'm proposing this functions:
So, copy of
*ast.Ident
with objects may be done this way:This can be wrapped by user into simple function:
This way, we avoid quite expensive copy that may be unnecessary in a first place and provide a way to copy objects if they are required.
Note that copying objects may be non-trivial.
It needs some investigation and problem overview beforehand.
The text was updated successfully, but these errors were encountered: