-
Notifications
You must be signed in to change notification settings - Fork 328
Error since upgrading to 1.6.1 #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@quentez not sure if is the same bug but the following throws with the same message // Note: this intersection always fails while decoding a value
const A = t.intersection([t.type({ type: t.literal('A') }), t.type({ type: t.literal('B') })])
const B = t.type({ type: t.literal('B') })
const C = t.taggedUnion('type', [A, B]) |
@quentez looks like the issue is also related to
I need your help, I just released a patch ( Example const A = t.type({ type: t.literal('A'), a: t.number }, 'A')
const B = t.refinement(A, x => x.a > 0, 'B')
const T = t.taggedUnion('type', [B, A]) // type-checks but T is not a tagged union In this case
Could you please try it out? |
@gcanti Version Thank you for the super quick turnaround 🙂 ! |
@quentez great, thanks for the bug report and the feedback |
We're making extensive use of Tagged Unions, and since upgrading to 1.6.1 we're now getting an error right when we declare our types:
Everything was working well in 1.6.0.
Our use-case in that file is pretty big and I can't just post it here. I'll have to try and reproduce it with a simpler case. The only thing I can see right now is that we're building a Tagged Union of Intersections (with the tag property being in one branch of the intersection).
The text was updated successfully, but these errors were encountered: