Running mypy with --disallow-untyped-decorators reports an error for overloaded decorators #4191
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
priority-1-normal
topic-overloads
Running mypy --disallow-untyped-decorators with a decorator that defines overloads always seems to report:
Untyped decorator makes function "xxx" untyped
Even though reveal_type(...) calls on the decorated functions seem to indicate type information.
Consider the following code.
Running mypy --disallow-untyped-decorators here yields the following (mypy 0.540):
The first error seems to be covered by other bug reports here (though, for all I know it may be related).
However, the second error seems to be contradicted by the type_reveal, which indicates at least the return type of the decorated "default" function is being picked up.
I may be missing something, but at very least, it seems like a more descriptive error may be warranted?
The text was updated successfully, but these errors were encountered: