Skip to content
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

Revision 0.32.17 #799

Merged
merged 2 commits into from Mar 20, 2024
Merged

Revision 0.32.17 #799

merged 2 commits into from Mar 20, 2024

Conversation

sinclairzx81
Copy link
Owner

@sinclairzx81 sinclairzx81 commented Mar 20, 2024

This PR adds a any type detection path for StaticDecode.

It is noted that even though the StaticDecode type is constrained to generic parameters of type TSchema; passing any for a parameter is still permissible as any does loosely satisfy this constraint. However in the context of StaticDecode, passing any does result in TS2589 instantiation issues due to any yielding union results when used as a left-side operand in conditional expressions (classic example below)

type T = any extends string ? 1 : 2 // T = 1 | 2

This PR attempts to catch any for StaticDecode specifically, principally because StaticDecode makes heavy use of conditional mapping, and where union results for any cause ambiguous resolution during type decoding.

@sinclairzx81 sinclairzx81 merged commit ec27004 into master Mar 20, 2024
18 checks passed
@sinclairzx81 sinclairzx81 deleted the any branch March 20, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant