this post was submitted on 23 Aug 2023
4 points (100.0% liked)

TypeScript

839 readers
1 users here now

founded 2 years ago
MODERATORS
top 6 comments
sorted by: hot top controversial new old
[–] cwagner@lemmy.cwagner.me 2 points 1 year ago (1 children)

Another piece from C#, now share the other way and give us all the union types, okay?

[–] kogasa@programming.dev 1 points 1 year ago (1 children)

Discriminated unions have been In The Works(tm) for quite a while. I believe they were cut from the C# 12 roadmap. But maybe C# 13?

I think a source-generation based approach similar to OneOf isn't unlikely.

[–] Lmaydev@programming.dev 1 points 1 year ago

Yeah unfortunately tacking them onto a 20 year old language is not easy.

It's great to see it being worked on but there is a long way to go.

[–] yads@lemmy.ca 1 points 1 year ago

That seems quite useful

[–] nickel@programming.dev 0 points 1 year ago (1 children)

Does using function as a const? Meaning: when a using variable is declared, is it immutable?

[–] burkybang@programming.dev 1 points 1 year ago

This comment sounds like you’re having a stroke if we didn’t know the context.