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; immutable scalar values such as strings may be shared safely by the runtime.
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