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

Fix invalid type causing namedtuple errors in wrong files #8549

Merged
merged 2 commits into from
Mar 17, 2020

Conversation

msullivan
Copy link
Collaborator

Fixes #8511.

This is a workaround of #4987, where UnboundTypes can leak.

Copy link
Collaborator

@Michael0x2a Michael0x2a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think UnboundTypes leaking is by design, right? (Though I do agree this design isn't great/we need tighter semantics around creating placeholders for bad types.)

But anyways, this fix LGTM. It's a bit unfortunate that the one failing test's reveal_type output degraded slightly, but I think that's fine.

def foo():
pass

Type1 = NamedTuple('Type1', [('foo', foo)]) # type: ignore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead we check the error message that's generated here to make sure it's something sensible?

Fixes #8511.

This is a workaround of #4987, where UnboundTypes can leak.
@msullivan msullivan merged commit 7f8ea4a into master Mar 17, 2020
@msullivan msullivan deleted the namedtuple-wrongfile branch March 17, 2020 21:07
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.

Wrong file blamed for a mixture of NamedTuple and passing a function instead of type.
2 participants