Remove redundant #![allow()] from main_native by andersk · Pull Request #1703 · astral-sh/ruff (original) (raw)
main_native.rs is a module of main.rs, so the #![allow()]s in the latter apply to the former automatically.
Signed-off-by: Anders Kaseorg andersk@mit.edu
bruxisma referenced this pull request in ixm-one/pytest-cmake-presets
suleymanozkeskin added a commit to suleymanozkeskin/ruff-ty-typeis-fix that referenced this pull request
Fixes astral-sh#1703
Fixes incomplete type narrowing when using TypeIs with generic union types like: Result[T, E] = Ok[T] | Err[E].
Previously, type parameter E was materialized to 'object' before specialization could substitute it with concrete types like Exception, causing narrowing to produce Err[Unknown] instead of Err[Exception].
Changes:
- Added is_materialized flag to TypeIsType to defer materialization
- Implemented class-based union element matching for multi-typevar unions in generics.rs
- Modified TypeIs creation to delay materialization until after specialization
- Added test case for generic TypeIs narrowing to type_guards.md
- Removed the comments which had a discussion about: astral-sh#20591
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})