Skip to content
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

Expand DeepCopy logic to mutable collections that contain primitives #45

Open
kMutagene opened this issue Dec 19, 2024 · 0 comments
Open
Assignees

Comments

@kMutagene
Copy link
Member

kMutagene commented Dec 19, 2024

e.g. ResizeArray<string> is not caught by any custom copy logic, and will be reference equal, leading to this:

#r "nuget: DynamicObj"
open DynamicObj

let r = new ResizeArray<string>(["1"; "2"])
let d1 = 
    DynamicObj()
    |> DynObj.withProperty "r" r

let d2 = d1.DeepCopyProperties() |> unbox<DynamicObj>

r.Add("3")

printfn "%A" d1?r // ["1"; "2"; "3"] 
printfn "%A" d2?r // ["1"; "2"; "3"] =(
@github-actions github-actions bot added the Status: Needs Triage This item is up for investigation. label Dec 19, 2024
@kMutagene kMutagene self-assigned this Dec 19, 2024
@kMutagene kMutagene moved this to In progress in ARCStack Dec 19, 2024
@kMutagene kMutagene removed the Status: Needs Triage This item is up for investigation. label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant