Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate definitions of type vars. #12

Closed
dlech opened this issue Apr 11, 2022 · 0 comments
Closed

Duplicate definitions of type vars. #12

dlech opened this issue Apr 11, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@dlech
Copy link
Contributor

dlech commented Apr 11, 2022

The code generator currently emits TypeVars for each class that uses them. However most classes reuse the same common names like T, K and V. Mypy complains about this with Cannot redefine "T" as a type variable mypy(error) and Invalid assignment target mypy(error).

To fix this, we would probably need to make a separate pass that iterates all of the classes in a module and collects the generic type arguments and only emits unique ones at the beginning of the module.

@dlech dlech added the bug Something isn't working label Apr 11, 2022
@dlech dlech closed this as completed in a177043 Apr 25, 2022
dlech added a commit that referenced this issue Apr 25, 2022
This reverts commit a177043.

It made mypy unhappy about generic type params in delegates.

Fixes: #12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant