Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Oct 10, 2025

When inferring a precise generator return type for an async def (or generator), make the generate returned by an override in a subclass inherit from the base class generator. This means that the environment has to be moved to a separate class in the base class generator.

Don't infer a precise generator return type when an override might have a less precise return type, since it would break LSP.

Fixes mypyc/mypyc#1141.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Oct 10, 2025

I'm still missing at least non-async generator inheritance tests.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError with async methods and inheritance

2 participants