File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2180,7 +2180,8 @@ def __init__(
21802180 self .dep_hashes = {
21812181 k : v for (k , v ) in zip (self .meta .dependencies , self .meta .dep_hashes )
21822182 }
2183- self .error_lines = self .meta .error_lines
2183+ # Only copy `error_lines` if the module is not silently imported.
2184+ self .error_lines = [] if self .ignore_all else self .meta .error_lines
21842185 if temporary :
21852186 self .load_tree (temporary = True )
21862187 if not manager .use_fine_grained_cache ():
Original file line number Diff line number Diff line change @@ -2465,6 +2465,25 @@ def foo(a: int, b: int) -> str:
24652465[out2]
24662466tmp/b.py:2: error: Incompatible return value type (got "int", expected "str")
24672467
2468+ [case testIncrementalWithSilentImportsReverse]
2469+ -- Same commands as previous test, just in reverse order.
2470+ -- expected output is also in reverse order
2471+ # cmd: mypy -m b
2472+ # cmd2: mypy -m a
2473+ # flags: --follow-imports=silent
2474+ [file a.py]
2475+ import b
2476+
2477+ b.foo(1, 2)
2478+
2479+ [file b.py]
2480+ def foo(a: int, b: int) -> str:
2481+ return a + b
2482+
2483+ [out]
2484+ tmp/b.py:2: error: Incompatible return value type (got "int", expected "str")
2485+ [out2]
2486+
24682487[case testForwardNamedTupleToUnionWithOtherNamedTUple]
24692488from typing import NamedTuple, Union
24702489
You can’t perform that action at this time.
0 commit comments