You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In reproduction, if you run mypy bar, you get the following error:
foo/bary.py:5: error: Recursive types not fully supported yet, nested types replaced with "Any"
foo/bary.py:9: error: Recursive types not fully supported yet, nested types replaced with "Any"
If you look carefully, you can see that the line numbers are OK, but the file reported is wrong. It should be bar/types.py. This is where recursive types are defined. In foo/bary.py they are only used. (And only used once, so if error would be about use of the recursive type and not definition, there should be only one error, not two.)
This is problematic because it is hard to silence these errors. The only way I found was to use mypy.ini and silence the whole module. And even in that case I had to silence the wrong module, foo.bary and not bar.types.
I tested this on mypy with merged #4384 and #4396.
(Reported before here, but opening now a separate issue.)
The text was updated successfully, but these errors were encountered:
The problem is that currently Context only contains line and column numbers, but not the module. However, this becomes problematic if some errors are detected where types are used, but it is logical to report them at type definition context. I don't have a simple solution for this yet.
In the meantime, could you please try to find a simpler repro? (I think just two files could be enough.)
In reproduction, if you run
mypy bar
, you get the following error:If you look carefully, you can see that the line numbers are OK, but the file reported is wrong. It should be
bar/types.py
. This is where recursive types are defined. Infoo/bary.py
they are only used. (And only used once, so if error would be about use of the recursive type and not definition, there should be only one error, not two.)This is problematic because it is hard to silence these errors. The only way I found was to use
mypy.ini
and silence the whole module. And even in that case I had to silence the wrong module,foo.bary
and notbar.types
.I tested this on mypy with merged #4384 and #4396.
(Reported before here, but opening now a separate issue.)
The text was updated successfully, but these errors were encountered: