ruff
1a3b7372 - [red-knot] Silence errors in unreachable type annotations / class bases (#17342)

Commit
83 days ago
[red-knot] Silence errors in unreachable type annotations / class bases (#17342) ## Summary For silencing `invalid-type-form` diagnostics in unreachable code, we use the same approach that we use before and check the reachability that we already record. For silencing `invalid-bases`, we simply check if the type of the base is `Never`. If so, we silence the diagnostic with the argument that the class construction would never happen. ## Test Plan Updated Markdown tests.
Author
Parents
  • crates/red_knot_python_semantic
    • resources/mdtest
      • File
        unreachable.md
    • src
      • File
        types.rs
      • types
        • File
          infer.rs