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
My hope is that the behavior within the body of the case would match the body of if: the const currently defined as notNarrowed should be identified as type FooInterface.
Actual behavior:
Within the body of an if statement, the type guard is evaluated and successfully narrows the object.
When evaluated as part of switch/case, the const notNarrowed is still seen as a GeneralInterface, despite being proven to be the more arrow FooInterface.
Apologies if I am missing anything, I greatly appreciate your time and work!
The text was updated successfully, but these errors were encountered:
Interesting and unfortunate, but thank you for linking me to that. I tried to find something like that but was unable. Is there any chance that this would be considered for resolution now? I'll leave this open for a maintainer to bring the Closehammer down. Thank you!
TypeScript Version: 2.4.2
Code
Expected behavior:
My hope is that the behavior within the body of the
case
would match the body ofif
: the const currently defined asnotNarrowed
should be identified as typeFooInterface
.Actual behavior:
Within the body of an
if
statement, the type guard is evaluated and successfully narrows the object.When evaluated as part of switch/case, the const
notNarrowed
is still seen as aGeneralInterface
, despite being proven to be the more arrowFooInterface
.Apologies if I am missing anything, I greatly appreciate your time and work!
The text was updated successfully, but these errors were encountered: