ruff/crates/ty_python_semantic/resources
David Peter 689797a984
[ty] Type narrowing in comprehensions (#18934)
## Summary

Add type narrowing inside comprehensions:

```py
def _(xs: list[int | None]):
    [reveal_type(x) for x in xs if x is not None]  # revealed: int
```

closes https://github.com/astral-sh/ty/issues/680

## Test Plan

* New Markdown tests
* Made sure the example from https://github.com/astral-sh/ty/issues/680
now checks without errors
* Made sure that all removed ecosystem diagnostics were actually false
positives
2025-06-25 11:30:28 +02:00
..
corpus Move corpus tests to ty_python_semantic (#18609) 2025-06-11 08:55:30 +02:00
mdtest [ty] Type narrowing in comprehensions (#18934) 2025-06-25 11:30:28 +02:00
primer [ty] Update mypy_primer, add two new projects (#18891) 2025-06-23 13:08:11 +02: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/ty_test/README.md for documentation of this test format.