by SebastianKra · 2y ago · 0 comments
In C# you can't work with optional generics because an optional reference type is different from an optional value type.
C#s poor type-inference often requires you to type out types thrice. You can't declare constants or class members with type-inferrence.
The only way to define sum-types (A | B | C) is through intefaces and I'm pretty sure they can't be sealed. Defining product-types (A & B & C) is impossible.
{name: string} & {birthday: Date}
becomes a single type with both properties.
Record types are tuple types with names instead of indexes.
The TypeScript “&” is another thing.