public native deepCopy() as this
Creates a deep copy of the current object graph.
The static return type is the receiver type, while the allocated object keeps the concrete runtime type of this. Object fields and collection elements are copied recursively. Mutable strings are copied as well; modifying copied text must not change the original graph.
Cycles and shared references are preserved during the copy.
A deep copy of the current object.
shape as Shape = Circle(10) copy = shape.deepCopy() assert copy is Shape assert copy is Circle