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

Complain about inferring UninhabitedType for a variable #4112

Merged
merged 1 commit into from Oct 13, 2017

Conversation

Projects
None yet
2 participants
@JukkaL
Collaborator

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.

Complain about inferring UninhabitedType for a variable
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

This comment has been minimized.

Show comment
Hide comment
@JukkaL

JukkaL Oct 13, 2017

Collaborator

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

Collaborator

JukkaL commented Oct 13, 2017

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

@ilevkivskyi

This comment has been minimized.

Show comment
Hide comment
@ilevkivskyi

ilevkivskyi Oct 13, 2017

Collaborator

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?

Collaborator

ilevkivskyi commented Oct 13, 2017

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

This comment has been minimized.

Show comment
Hide comment
@JukkaL

JukkaL Oct 13, 2017

Collaborator

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

Collaborator

JukkaL commented Oct 13, 2017

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

@JukkaL

This comment has been minimized.

Show comment
Hide comment
@JukkaL

JukkaL Oct 13, 2017

Collaborator

Updated the description to mention that this fixes #4104.

Collaborator

JukkaL commented Oct 13, 2017

Updated the description to mention that this fixes #4104.

@ilevkivskyi

This comment has been minimized.

Show comment
Hide comment
@ilevkivskyi

ilevkivskyi Oct 13, 2017

Collaborator

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

Collaborator

ilevkivskyi commented Oct 13, 2017

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

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@gvanrossum gvanrossum deleted the infer-uninhabited branch Oct 13, 2017

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