#typescript DU types require an explicit discriminating field
type T1 = {type:"one"};
type T2 = {type:"two"};
type U = |T1 | T2;
So you have to write field 'type' explicitly. But then you can still compile `var v : U = {} as T1;`. There are reasons, but it still feels weird coming from #fsharp
9 months ago