You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Small repro in sum-types repo (to prove it's not (only) because we're reconstructing it):
typeSerialized1<AextendsSum.AnyMember>=[Tag<A>,Value<A>]// this preserves the nametypeSerialized2<A>=AextendsSum.AnyMember ? [Tag<A>,Value<A>] : never// this does nottypeX=Sum.Member<'X',string>|Sum.Member<'Y',number>declareconstx1: Serialized1<X>// aliasedif(x1[0]==="X")x1[1]// string | numberdeclareconstx2: Serialized2<X>// expandedif(x2[0]==="X")x2[1]// string
We're using the conditional type to distribute over union members.
As an aside we should probably export Serialized for both this and the fp-ts bindings repo. I also wonder if that would remove the need for some of the assertions?
The text was updated successfully, but these errors were encountered:
sum-types-io-ts/test/type/index.ts
Line 9 in 33fa3b3
Small repro in sum-types repo (to prove it's not (only) because we're reconstructing it):
We're using the conditional type to distribute over union members.
As an aside we should probably exportSerialized
for both this and the fp-ts bindings repo. I also wonder if that would remove the need for some of the assertions?The text was updated successfully, but these errors were encountered: