Skip to content

Complain about inferring UninhabitedType for a variable #4112

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 1 commit into from
Oct 13, 2017

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Oct 13, 2017

These don't really make sense as variable types, most of the time.
Also, don't turn them into partial None types, since UninhabitedType
and None no longer have any correspondence.

Fixes #4104.

These don't really make sense as variable types, most of the time.
Also, don't turn them into partial None types, since UninhabitedType
and None no longer have any correspondence.
@JukkaL
Copy link
Collaborator Author

JukkaL commented Oct 13, 2017

Don't merge yet -- I want to fix an issue in internal Dropbox code first.

@ilevkivskyi
Copy link
Member

So does this fix the problem with:

def f() -> T: pass

x = f()
reveal_type(x)  # None

If yes then maybe it makes sense to add a test for this?

@JukkaL
Copy link
Collaborator Author

JukkaL commented Oct 13, 2017

Yes, there is an existing test case that was skipped (testUnderspecifiedInferenceResult).

@JukkaL
Copy link
Collaborator Author

JukkaL commented Oct 13, 2017

Updated the description to mention that this fixes #4104.

@ilevkivskyi
Copy link
Member

Ah, OK, but then #4059 should be updated after you merge this, since the reveal_type you added will start working.

@JukkaL JukkaL merged commit 1993fdf into master Oct 13, 2017
@gvanrossum gvanrossum deleted the infer-uninhabited branch October 13, 2017 18:04
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.

2 participants