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
More context: This is a problem for TypeScript ESLint's "no-unnecessary-type-assertion" rule, which relies on the ! operator not changing the type of the underlying expression.
(@bradzacher, please correct me if I'm misrepresenting anything.)
In the following example, hovering the as always gives the same type:
TypeScript Version: 3.8.0-dev.20191128
Search Terms: ! type assertion, never, wrong type
Code
Expected behavior:
Hovering gives the type
never
.Actual behavior:
Hovering gives the type
A
.Playground Link: The TS playground doesn't work for me
Related Issues: typescript-eslint/typescript-eslint#1282
More context: This is a problem for TypeScript ESLint's "no-unnecessary-type-assertion" rule, which relies on the
!
operator not changing the type of the underlying expression.(@bradzacher, please correct me if I'm misrepresenting anything.)
In the following example, hovering the
a
s always gives the same type:The text was updated successfully, but these errors were encountered: