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
Expected behavior:
No Error; Actual behavior:
Type string is not assignable to type 'bar';
I don't know if this behavior is intended.
I think type inference should be more accurate in this case to make programmers not to write as sometype once again.
The text was updated successfully, but these errors were encountered:
Note there have been dozens of issues about inheriting exact signatures, and @sandersn worked very hard on multiple potential implementations. See #6118 and #10570 where this is discussed in detail.
Personally, the compile time checked immutability in the above workaround is a nice side-effect at least.
TypeScript Version: 2.2.2
Code
workaround:
Expected behavior:
No Error;
Actual behavior:
Type string is not assignable to type 'bar';
I don't know if this behavior is intended.
I think type inference should be more accurate in this case to make programmers not to write
as sometype
once again.The text was updated successfully, but these errors were encountered: