Repository navigation
[ty] Preserve generic alias identity during cycle recovery - #26166
Merged
Merged
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 94.37%. The percentage of expected errors that received a diagnostic held steady at 89.00%. The number of fully passing files held steady at 94/134. |
charliermarsh
marked this pull request as ready for review
June 19, 2026 21:40
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-type-form |
0 | 5 | 0 |
| Total | 0 | 5 | 0 |
Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.
Raw diff:
pytest-robotframework (https://github.com/detachhead/pytest-robotframework)
- pytest_robotframework/_internal/pytest/robot_file_support.py:40:30 error[invalid-type-form] Variable of type `type[Keyword]` is not allowed in a type expression
- pytest_robotframework/_internal/pytest/robot_file_support.py:42:33 error[invalid-type-form] Variable of type `type[Keyword]` is not allowed in a type expression
- pytest_robotframework/_internal/pytest/robot_file_support.py:127:37 error[invalid-type-form] Variable of type `type[Keyword]` is not allowed in a parameter annotation
- pytest_robotframework/_internal/robot/utils.py:21:32 error[invalid-type-form] Variable of type `type[Keyword]` is not allowed in a type expression
- pytest_robotframework/_internal/robot/utils.py:25:34 error[invalid-type-form] Variable of type `type[Keyword]` is not allowed in a type expression
charliermarsh
force-pushed
the
charlie/fix-steam-instability
branch
from
June 22, 2026 14:56
210be74 to
5b72c80
Compare
carljm
approved these changes
Jun 22, 2026
| current.cycle_normalized(db, *previous, cycle) | ||
| } | ||
|
|
||
| #[salsa::tracked( |
Contributor
There was a problem hiding this comment.
I think in addition to this unit test, it would be useful to preserve the end-to-end case as an mdtest regression test, including validating that the merged alias remains a valid class base and that Member.rank is inherited.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After the tainted iterations, cycle recovery normally unions the current and previous query results to force monotonic convergence. When a cyclic generic base alternated between specializations of the same class, such as
Outer[int]andOuter[Unknown], that produced a union of generic alias class objects. The union is not a valid class base, so downstream inheritance lost the shared class identity and inherited attributes becameUnknown.This keeps the generic alias origin intact and merges the approximations within its specialization. Equal arguments are retained, while a plain
Unknownwidens the corresponding argument. Mismatched known arguments continue through the existing union path, andUnknownGenericremains distinct so we preserve its generic context.The regression coverage drives a deterministic Salsa cycle through the production recovery path and checks the merge policy for known invariant arguments and
UnknownGeneric. An end-to-end mdtest also preserves the cross-module cyclic generic base and verifies thatMember.rankremains inherited asint.Closes astral-sh/ty#3812.