Skip to content

Report attribute access errors for TypeVar bound to Union. #11140

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

Merged
merged 3 commits into from
Sep 19, 2021

Conversation

tyralla
Copy link
Collaborator

@tyralla tyralla commented Sep 18, 2021

Fixes #10948

I have briefly discussed the problem with @hauntsaninja on Gitter.

The solution is straightforward. All checks were there, but a missing isinstance check prevented the detected errors from being reported.

The added test case includes examples for getting, setting, and deleting undefined attributes.

@hauntsaninja
Copy link
Collaborator

Looks great, thanks for triaging and fixing!

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.

generics with a union bound aren't type checked
2 participants