Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Reject inconsistent generic bases in dynamic classes#25413

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/dynamic-generic-base-conflicts
May 27, 2026
Merged

[ty] Reject inconsistent generic bases in dynamic classes#25413
charliermarsh merged 1 commit into
mainfrom
charlie/dynamic-generic-base-conflicts

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

We do this for static classes, but were missing the analysis for dynamic classes.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label May 27, 2026
@astral-sh-bot

astral-sh-bot Bot commented May 27, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 89.70%. The percentage of expected errors that received a diagnostic held steady at 86.99%. The number of fully passing files held steady at 91/134.

@astral-sh-bot

astral-sh-bot Bot commented May 27, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@charliermarsh charliermarsh force-pushed the charlie/dynamic-generic-base-conflicts branch from 1773e57 to 8dd2f23 Compare May 27, 2026 12:04
@astral-sh-bot

astral-sh-bot Bot commented May 27, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 0 4 12
Total 0 4 12
Raw diff (16 changes)
Expression (https://github.com/cognitedata/Expression)
- expression/collections/maptree.py:113:25 error[invalid-argument-type] Argument to function `mk` is incorrect: Argument type `Key@rebalance | Value@rebalance` does not satisfy upper bound `SupportsLessThan` of type variable `Key`
+ expression/collections/maptree.py:113:25 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`
- expression/collections/maptree.py:113:25 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`
+ expression/collections/maptree.py:113:28 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`
- expression/collections/maptree.py:113:28 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`
+ expression/collections/maptree.py:113:38 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
- expression/collections/maptree.py:113:38 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
- expression/collections/maptree.py:121:27 error[invalid-argument-type] Argument to function `mk` is incorrect: Argument type `Key@rebalance | Value@rebalance` does not satisfy upper bound `SupportsLessThan` of type variable `Key`
+ expression/collections/maptree.py:121:27 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`
- expression/collections/maptree.py:121:27 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`
+ expression/collections/maptree.py:121:30 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`
- expression/collections/maptree.py:121:30 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`
+ expression/collections/maptree.py:121:40 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
- expression/collections/maptree.py:121:40 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
- expression/collections/maptree.py:136:29 error[invalid-argument-type] Argument to function `mk` is incorrect: Argument type `Key@rebalance | Value@rebalance` does not satisfy upper bound `SupportsLessThan` of type variable `Key`
+ expression/collections/maptree.py:136:29 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`
- expression/collections/maptree.py:136:29 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`
+ expression/collections/maptree.py:136:32 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
- expression/collections/maptree.py:136:32 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
+ expression/collections/maptree.py:136:49 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`
- expression/collections/maptree.py:136:49 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`
- expression/collections/maptree.py:141:61 error[invalid-argument-type] Argument to function `mk` is incorrect: Argument type `Key@rebalance | Value@rebalance` does not satisfy upper bound `SupportsLessThan` of type variable `Key`
+ expression/collections/maptree.py:141:61 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`
- expression/collections/maptree.py:141:61 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`
+ expression/collections/maptree.py:141:64 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
- expression/collections/maptree.py:141:64 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
+ expression/collections/maptree.py:141:81 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`
- expression/collections/maptree.py:141:81 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance | Value@rebalance, Value@rebalance]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`

Full report with detailed diff (timing results)

@charliermarsh charliermarsh marked this pull request as ready for review May 27, 2026 12:35
@charliermarsh charliermarsh merged commit d860712 into main May 27, 2026
59 checks passed
@charliermarsh charliermarsh deleted the charlie/dynamic-generic-base-conflicts branch May 27, 2026 12:35
anishgirianish pushed a commit to anishgirianish/ruff that referenced this pull request May 28, 2026
…25413)

## Summary

We do this for static classes, but were missing the analysis for dynamic
classes.
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.

2 participants