Open msullivan opened 5 years ago
There is a related seeming bug with NamedTuples whose names don't match their line numbers:
[case testRetargetReexportNamedTuple]
from m import M
def f(x: M) -> None: ...
f(M(0))
[file m.py]
from n import M
[file n.py]
from typing import NamedTuple
M = NamedTuple('_N', [('x', int)])
[file n.py.2]
# oh no
from typing import NamedTuple
M = NamedTuple('_N', [('x', int)])
[out]
==
Fails with Argument 1 to "f" has incompatible type "_N@3"; expected "_N@2"
Here it is also arguably a bug that the names get messed up like that, but it works if there is not a re-export...
I think I was also hit by this recently. I raise the priority to high, since this is a relatively large area where daemon's behavior is problematic.
Consider the following test:
The daemon fails in step two with the error
Argument 1 to "f" has incompatible type "q.M"; expected "n.M"