-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
having trouble with deep copying a CtElement in Scala #3082
Comments
Which type of element are you cloning? What happens when you call |
I'm using CtMethod
I should mention, I am doing these operations using scala, not java. |
@monperrus any suggestions? |
The problem comes from Scala and is related to #2710. I'm not knowledgeable enough in Scala to fix it. But I'd be happy to merge a PR that makes the life of Scala users easier. |
Ah i see, ok I'll see what I can do. |
Hey I wanted to give an update. While I'm too busy to package that up nicely and submit a formal PR, I suspect the best thing to do would be to create a java utility method (i.e. CtElementUtil) that contains a trivial clone method, shown below. Perhaps one of you guys can do that?
|
that's a good idea! |
I would like to deep copy the entire AST of a CtElement, especially when I want to use parts of the sub-tree to create brand new CtElements
The Clone method available to all
CtElement
types are protectedI had this issue last year, see link below
#1978
Any help much appreciated!
The text was updated successfully, but these errors were encountered: