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
While trying to use @swan-io/boxed integration with ts-pattern, I found a case in which P.select() should extract an any value, but instead returns a parent level data structure type. This only occurs if the "selected" value is of type any. In other cases, the guessed type is OK.
You can see the original discussion on @swan-io/boxed repo, but here is the most important part:
My problem is on the line 28. I am trying to extract the Result.Ok value using P.select(), but the compiler says that this is the Result.Ok itself, instead of the value it holds.
TypeScript playground with a minimal reproduction case
Describe the bug
While trying to use @swan-io/boxed integration with ts-pattern, I found a case in which
P.select()
should extract anany
value, but instead returns a parent level data structure type. This only occurs if the "selected" value is of typeany
. In other cases, the guessed type is OK.You can see the original discussion on @swan-io/boxed repo, but here is the most important part:
TypeScript playground with a minimal reproduction case
Example with error: Playground
Example without error: Playground
Versions
The text was updated successfully, but these errors were encountered: