* origin/main: (114 commits)
[ty] Detect disjointness due to incompatible generic specializations (#24822)
Update Rust crate memchr to v2.8.1 (#25586)
[ty] Reject Self in type aliases (#25529)
Update Rust crate log to v0.4.30 (#25572)
Update Rust crate mimalloc to v0.1.52 (#25573)
Update Rust crate similar to v3.1.1 (#25575)
Update docker/setup-buildx-action action to v4.1.0 (#25580)
Update docker/metadata-action action to v6.1.0 (#25579)
Update docker/login-action action to v4.2.0 (#25578)
Update docker/build-push-action action to v7.2.0 (#25577)
Update taiki-e/install-action action to v2.79.9 (#25576)
Update Rust crate serde_json to v1.0.150 (#25574)
Update Rust crate assert_fs to v1.1.4 (#25570)
Update prek dependencies (#25569)
Update dependency ruff to v0.15.15 (#25568)
Update dependency pyright to v1.1.410 (#25566)
Update dependency astral-sh/uv to v0.11.18 (#25565)
[ty] don't needlessly disambiguate same type alias (#25563)
[ty] fix variance inference for nested type aliases (#25567)
[ty] treat union-bound typevars like unions for possibly-missing-attribute (#25561)
...
# Conflicts:
# crates/ty_python_semantic/src/types/class.rs
# crates/ty_python_semantic/src/types/generics.rs
# crates/ty_python_semantic/src/types/type_alias.rs
Summary
The spec says: "We reject type aliases containing
Self." Some type checkers, such as Pyright, support class-scoped aliases containingSelf, but Mypy rejects them.This change rejects
Selfin the value of explicit PEP 613TypeAliasdeclarations and PEP 695typestatements:For rejected PEP 613 aliases, we recover
SelfasUnknowneven wheninvalid-type-formis disabled, so suppressing the diagnostic does not preserve a receiver-boundSelftype.Implicit aliases, PEP 695 alias type-parameter bounds and defaults, direct
TypeAliasType(...)definitions, andSelfintroduced indirectly through runtime-expression forms remain unchanged for now.Selfin runtime-expression positions such asAnnotatedmetadata also remains allowed because those expressions are not part of the alias value type expression.