Skip to content

Add missing dependency from missing module attribute #5861

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 2 commits into from
Nov 1, 2018
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Oct 31, 2018

Fixes #4782.

@JukkaL JukkaL requested a review from ilevkivskyi October 31, 2018 11:22
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

A nice simple solution. I have two suggestions.

[out]
<a.C.x> -> m
<a.C> -> m

Copy link
Member

Choose a reason for hiding this comment

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

I would add a fine grained test too, so that it will not regress for other (non dependency caused) reasons.

@@ -604,6 +604,10 @@ def visit_member_expr(self, e: MemberExpr) -> None:
# No type available -- this happens for unreachable code. Since it's unreachable,
# it wasn't type checked and we don't need to generate dependencies.
return
if isinstance(e.expr, RefExpr) and isinstance(e.expr.node, MypyFile):
# Special case: reference to a missing module attribute.
Copy link
Member

Choose a reason for hiding this comment

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

I would also update the comment few lines above (can't comment there):

# Reference to a non-module attribute -> # Reference to a non-module (or missing) attribute

@JukkaL JukkaL merged commit 0b61e54 into master Nov 1, 2018
@gvanrossum gvanrossum deleted the fg-ignore-attr branch November 14, 2018 04:08
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