Skip to content

[ty] Unions/intersections of gradual types should be assignable to Never#24056

Merged
ibraheemdev merged 2 commits intomainfrom
ibraheem/never-assignability
Mar 19, 2026
Merged

[ty] Unions/intersections of gradual types should be assignable to Never#24056
ibraheemdev merged 2 commits intomainfrom
ibraheem/never-assignability

Conversation

@ibraheemdev
Copy link
Member

This showed up in #23761 with Divergent | Any.

@ibraheemdev ibraheemdev added the ty Multi-file analysis & type inference label Mar 19, 2026
@ibraheemdev ibraheemdev marked this pull request as ready for review March 19, 2026 19:32
@astral-sh-bot
Copy link

astral-sh-bot bot commented Mar 19, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 85.29%. The percentage of expected errors that received a diagnostic held steady at 78.13%. The number of fully passing files held steady at 64/132.

Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. It might be worth running the property tests on this branch.

from ty_extensions import static_assert, is_assignable_to, Unknown, Intersection
from typing_extensions import Never, Any

static_assert(is_assignable_to(Any, Never))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same test in type_compendium/any.md, but it's obviously fine to repeat it here.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Mar 19, 2026

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Mar 19, 2026

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@ibraheemdev ibraheemdev merged commit ffeee66 into main Mar 19, 2026
49 checks passed
@ibraheemdev ibraheemdev deleted the ibraheem/never-assignability branch March 19, 2026 20:02
carljm added a commit that referenced this pull request Mar 25, 2026
* main:
  [`flake8-bandit`] Check tuple arguments for partial paths in `S607` (#24080)
  [ty] Update Salsa (#24081)
  Update Rust toolchain to 1.94 and MSRV to 1.92 (#24076)
  [ty] Move ruffen-docs formatting config to a `ruff.toml` config file (#24074)
  [ty] `reveal_type` diagnostics in unreachable code (#24070)
  [ty] Improve keyword argument narrowing for nested dictionaries (#24010)
  [ty] Preserve blank lines between comments and imports in add-import action (#24066)
  [ty] Add diagnostic hint for invalid assignments involving invariant generics (#24032)
  Clarify `extend-ignore` and `extend-select` settings documentation (#24064)
  [ty] Batch changes to watched paths (#24045)
  replace deprecated `std::f64::EPSILON` with `f64::EPSILON` (#24067)
  [ty] Fix untracked reads in Salsa queries that can lead to backdating panics (#24051)
  [ty] Unions/intersections of gradual types should be assignable to `Never` (#24056)
  Fix incorrect path for ty_python_semantic in fuzzer (#24052)
  Bump 0.15.7 (#24049)
  [ty] ecosystem-analyzer: Fail on newly panicking projects (#24043)
  Don't show noqa hover for non-Python documents (#24040)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants