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
functionisNumber(value: number|string): value is number{returntypeofvalue==='number'}constval=1asnumber|string|nullmatch([val]).with([P.when(isNumber)],()=>'number').exhaustive()
This does fail, which shows the desired behavior:
functionisNumber(value: unknown): value is number{returntypeofvalue==='number'}constval: number|null=1match([valasnumber|null]).with([P.when(isNumber)],()=>'number').exhaustive()// type error
This also fails since the input satisfies the parameter in isNumber
functionisNumber(value: number|string|null): value is number{returntypeofvalue==='number'}constval: number|null=1match([valasnumber|null]).with([P.when(isNumber)],()=>'number').exhaustive()// type error
Describe the bug
This does not fail, which is a bug:
This does fail, which shows the desired behavior:
This also fails since the input satisfies the parameter in
isNumber
Code Sandbox with a minimal reproduction case
https://codesandbox.io/s/jovial-thunder-nsg2gc
Versions
The text was updated successfully, but these errors were encountered: