winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
5.07k stars 198 forks source link

Missing `MutJson.copy()` and `Json.copyMut()` #6919

Open eladb opened 4 months ago

eladb commented 4 months ago

I tried this:

let x = MutJson { y: 123 };
let y: Json = x.copy();
let z: MutJson = y.copyMut();

This happened:

Couldn't find these methods.

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

tsuf239 commented 3 months ago

it seems like the functionality exists but in a bit messier way:

let x = MutJson { y: 123 };
let y: Json = Json.deepCopy(x);
let z: MutJson = Json.deepCopyMut(y);

works.

Should I change it to be structured similarly to your example, or should I just leave it as is?