Skip to content

Reexported imports not tracked properly in fine-grained incremental mode #4512

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

Closed
msullivan opened this issue Jan 25, 2018 · 0 comments · Fixed by #4761
Closed

Reexported imports not tracked properly in fine-grained incremental mode #4512

msullivan opened this issue Jan 25, 2018 · 0 comments · Fixed by #4761
Labels

Comments

@msullivan
Copy link
Collaborator

We fail to propagate changes when the target of an import changes.

Here, we swap what module a imports foo from, but m.f doesn't get rechecked.

[case testImportSwap]
from a import foo
def f() -> int:
    return foo()

[file a.py]
from b1 import foo
[file a.py.2]
from b2 import foo

[file b1.py]
def foo() -> int:
    return 12
[file b2.py]
def foo() -> str:
    return 'uhoh'
[out]
==
main:3: error: Incompatible return value type (got "str", expected "int")

Same thing if we switch from a importing foo to just defining it.

[case testImportSwap2]
from b import foo
def f() -> int:
    return foo()

[file a.py]
from b import foo
[file a.py.2]
def foo() -> str:
    return 'uhoh'

[file b.py]
def foo() -> int:
    return 12
[out]
==
main:3: error: Incompatible return value type (got "str", expected "int")

Same problem without using from in m.

[case testImportSwap3]
import a
def f() -> int:
    return a.foo()
[file a.py]
from b1 import foo
[file a.py.2]
from b2 import foo

[file b1.py]
def foo() -> int:
    return 12
[file b2.py]
def foo() -> str:
    return 'uhoh'
[out]
==
main:3: error: Incompatible return value type (got "str", expected "int")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant