Skip to content

fix support creation of union from generic class constructor #1134#4152

Open
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:1134
Open

fix support creation of union from generic class constructor #1134#4152
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:1134

Conversation

@asukaminato0721

@asukaminato0721 asukaminato0721 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1134

Generic constructors now expand union arguments against union type hints and union successful specializations, and all expansions must match, preventing unsafe mixed-argument cases.

Test Plan

add test

@github-actions

Copy link
Copy Markdown

Diff from mypy_primer, showing the effect of this PR on open source code:

rotki (https://github.com/rotki/rotki)
- ERROR rotkehlchen/api/services/transactions.py:474:36-478:14: `dict[CHAINS_WITH_TRANSACTIONS_TYPE, list[BTCAddress | ChecksumAddress | SolanaAddress | SubstrateAddress]]` is not assignable to variable `blockchain_addresses` with type `dict[CHAINS_WITH_TRANSACTIONS_TYPE, ListOfBlockchainAddresses]` [bad-assignment]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support creation of union from generic class constructor

1 participant