ruff/crates/red_knot_python_semantic/resources
Shunsuke Shibayama 1977dda079
[red-knot] respect `TYPE_CHECKING` even if not imported from typing (#16468)
## Summary

This PR closes #15722.

The change is that if the variable `TYPE_CHECKING` is defined/imported,
the type of the variable is interpreted as `Literal[True]` regardless of
what the value is.
This is compatible with the behavior of other type checkers (e.g. mypy,
pyright).

## Test Plan

I ran the tests with `cargo test -p red_knot_python_semantic` and
confirmed that all tests passed.

---------

Co-authored-by: Carl Meyer <carl@astral.sh>
2025-03-04 07:58:29 -08:00
..
mdtest [red-knot] respect `TYPE_CHECKING` even if not imported from typing (#16468) 2025-03-04 07:58:29 -08:00
README.md [red-knot] document test framework (#13695) 2024-10-10 12:02:01 -07:00

README.md

Markdown files within the mdtest/ subdirectory are tests of type inference and type checking; executed by the tests/mdtest.rs integration test.

See crates/red_knot_test/README.md for documentation of this test format.