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
letvalue2: MyClass|string;if(value2instanceofMyClass){value2.prop=true;// value2 is a MyClass inside the if-block. No typecast needed.}
The reason it doesn't in your example is specifically because value is of any type, which instanceof doesn't narrow. See #1426 for why it works this way.
Hello,
Here is my code:
It would be great to support this feature.
Thanks in advance and I hope this could help others.
The text was updated successfully, but these errors were encountered: