Closed
Description
If we visit cast(x, T)
and the inferred type of x
is a subtype of T
then we should emit a warning. Unnecessary casts are bad casts.
There should also be a way to make this an error instead of a warning (for example, so we can enforce that we don't have any unnecessary casts in the mypy codebase).