Skip to content

Fix adding a class in a new module and using it - #4761

Merged
msullivan merged 2 commits into
masterfrom
module_busted
Mar 20, 2018
Merged

msullivan merged 2 commits into
masterfrom
module_busted

Conversation

@msullivan

Copy link
Copy Markdown
Collaborator

We add a field to AnyType indicating---if it was created because of a
failed import---what the full name of the imported name is (that is,
the name in the importing module).

An eventual better solution might be to always generate dependencies to the locally imported name of variables. That would fix #4512 as well.

We add a field to AnyType indicating---if it was created because of a
failed import---what the full name of the imported name is (that is,
the name in the importing module).
@msullivan
msullivan requested a review from JukkaL March 20, 2018 00:59

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems like a reasonable fix for now. Agreed that generating dependencies from locally imported names would be a better long-term approach. I added one comment about additional test case.

Comment thread test-data/unit/deps.test Outdated
[out]
<a[wildcard]> -> m

[case testMissingModuleClass]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Try with an import from a package as well (such as from p.b import A) and using from p import *.

@msullivan
msullivan merged commit b497216 into master Mar 20, 2018
@msullivan
msullivan deleted the module_busted branch March 20, 2018 20:42
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.

Reexported imports not tracked properly in fine-grained incremental mode

2 participants