Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,8 @@ def __init__(
self.dep_hashes = {
k: v for (k, v) in zip(self.meta.dependencies, self.meta.dep_hashes)
}
self.error_lines = self.meta.error_lines
# Only copy `error_lines` if the module is not silently imported.
self.error_lines = [] if self.ignore_all else self.meta.error_lines
if temporary:
self.load_tree(temporary=True)
if not manager.use_fine_grained_cache():
Expand Down
19 changes: 19 additions & 0 deletions test-data/unit/check-incremental.test
Original file line number Diff line number Diff line change
Expand Up @@ -2465,6 +2465,25 @@ def foo(a: int, b: int) -> str:
[out2]
tmp/b.py:2: error: Incompatible return value type (got "int", expected "str")

[case testIncrementalWithSilentImportsReverse]
-- Same commands as previous test, just in reverse order.
-- expected output is also in reverse order
# cmd: mypy -m b
# cmd2: mypy -m a
# flags: --follow-imports=silent
[file a.py]
import b

b.foo(1, 2)

[file b.py]
def foo(a: int, b: int) -> str:
return a + b

[out]
tmp/b.py:2: error: Incompatible return value type (got "int", expected "str")
[out2]

[case testForwardNamedTupleToUnionWithOtherNamedTUple]
from typing import NamedTuple, Union

Expand Down