-
-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to deep clone a CTExpression? #1978
Comments
Use the clone method that is available on all CtElement |
Ah yes, I forgot to mention I tried that but then my code doesn't build. Error:(60, 35) method clone in class Object cannot be accessed in spoon.reflect.code.CtExpression[Any] |
Are you in Scala? |
Yes I am using Scala 2.12 |
And what about |
Closing this issue, don't hesitate to reopen! |
I'm noticing that when I do a transformation on a CTElement (specifically an expression) it does not create a new element but rather mutates the original .
I would like to copy the original element and output a transformed version (i.e. using replace, add, or delete) without modifying the original element.
Any suggestions much appreciated!
The text was updated successfully, but these errors were encountered: