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
Describe the bug
Hey, first of all thanks for the awesome library 🙏 I have a small issue where .match() with .exhaustive() is not working with a readonly array, I included screenshots of the issue.
match(value)// value: string | Date | readonly string[].with(P.string,(value)=> ...).with(P.array(P.string),(value)=> ...).with(P.instanceOf(Date),(value)=> ...).exhaustive()// Complains about "Type 'NonExhaustiveError<readonly string[]>' has no call signatures."
Interestingly enough, the value is correct inside the P.array(P.string)) condition: value: string[] | readonly string[].
Describe the bug
Hey, first of all thanks for the awesome library 🙏 I have a small issue where
.match()
with.exhaustive()
is not working with a readonly array, I included screenshots of the issue.Interestingly enough, the value is correct inside the
P.array(P.string))
condition:value: string[] | readonly string[]
.TypeScript playground with a minimal reproduction case
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbziAhjAxgCwDRwApwC+cAZlBCHAOQwDOAtGGjAKZQB2VAUFzAJ5gWcAGooANgFchAXji0YUYOwDmcAD5woLFABMI7MXzkKlygNoBddXAAiaFgG4eOlujEotcdPvlwAbuJSAFwigY48qBiYABQBkiwAlFxwKXAAdADuwDAxeGnyiiq4sWEJcNIAfHAAjEmp6Vk50XkeUCh8zfkmKgnFcVJllXAATHWpmdm5aUryKOzoLADyJNF2rL1wJfGDVQDMYylpLAAemCgS8sB+LNFJQA
Versions
The text was updated successfully, but these errors were encountered: