-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
TS error when declaring "pattern" using P.string as a variable. #174
Comments
Hey, could you provide a playground with a reproduction case? I do not reproduce this issue: Playground Btw it's recommended to use const isFoo = {
type: 'foo',
data: P.string
} as const |
That's strange. I realised now that the error actually arises when you export |
Look promising! Thanks for the quick assistance! |
Fixed in v5.0.3 |
Hello and thanks for the great work on this library!
I'm currently bumping TS and ts-pattern to v5 and ran into an unexpected issue.
Prior to v5, I've had some patterns declared to variables, like this:
After upgrading ts and ts-pattern, I now get an error on
isFoo
:The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. (tsserver 7056)
Removing the
P.string
also removes the errorUsing
P.string
"inline" does not give this error.ts-pattern 5.0.1
TS 5.1.6
Any ideas?
Thanks in advance.
The text was updated successfully, but these errors were encountered: