Skip to content

Shallow copy of object #3367

Closed
Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


What steps will reproduce the problem?

It seems to be unnecessary difficult to create a shallow copy of an object (please correct me if I am wrong). I couldn't find another way than to implement a method copy() in each subclass of a class hierarchy that would only call its own constructor to create a new object of the same type and with the same field values.

What is the expected output? What do you see instead?

I see that a copy() method in Object might not be desirable, but it would be very useful if Dart somehow had the possibility to create a new instance of an object with identical field values (shallow copy, clone).

What version of the product are you using? On what operating system?

Dart SDK version 7904

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.closed-not-plannedClosed as we don't intend to take action on the reported issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions