ruff/crates/red_knot_python_semantic/resources/mdtest/directives
Alex Waygood ca0cce3f9c
[red-knot] Fix more [redundant-cast] false positives (#17170)
Fixes #17164. Simply checking whether one type is gradually equivalent
to another is too simplistic here: `Any` is gradually equivalent to
`Todo`, but we should permit users to cast from `Todo` or `Unknown` to
`Any` without complaining about it. This changes our logic so that we
only complain about redundant casts if:
- the two types are exactly equal (when normalized) OR they are
equivalent (we'll still complain about `Any -> Any` casts, and about
`Any | str | int` -> `str | int | Any` casts, since their normalized
forms are exactly equal, even though the type is not fully static -- and
therefore does not participate in equivalence relations)
- AND the casted type does not contain `Todo`
2025-04-03 15:00:00 +01:00
..
assert_type.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
cast.md [red-knot] Fix more [redundant-cast] false positives (#17170) 2025-04-03 15:00:00 +01:00