Definitions under `TYPE_CHECKING` should not be importable
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
In trying to make our codebase generally compliant with [quoted annotations](https://docs.astral.sh/ruff/settings/#lint_flake8-type-checking_quote-annotations), we ran into the issue of identifying modules that were unintentionally importing definitions as a re-export, rather from the file of definitional source of truth.
When converting to quoted annotations, these re-exports become nested in a conditional, and should no longer be importable to other modules. However, pyrefly does not flag this.
Similar to https://github.com/facebook/pyrefly/issues/3624, we should not include these declarations.
### Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEALqcROgOZ0Q3G6UN0AVAJoAFAKIB9AMIAJMVIDSASQByAcQA66LRDCDRk2fOXrEWuhbr46AXjoBGEABoQ2EuURVadNFjzWuHj4rZxAyShgwKFJCBlooCgBiOhFSCKjSHwwcAjoAY1x0SDYAV0pUBghCwi1kgGUYGDoACwYGYjhEAHou8Mjowl42Lph0LsxcPLgugqKIUvLKwq66MF46VAA3VGhUbFh8wuKyiqr0OlxiJfQ4GvQyBmbCgFpNmEo4M9s6DRAAZkI9gATL8tABtd7UD4AXS0JXQgV4DBgmGemAgETylTe3wA5PN0LwYLitISGM8IgBHEoYlHPADWMFIz1QeTy8DgeIA7qhKOgSegQABfFys7EwABi0BgFDcZGFQA
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.