Description
Bug Report
Explicit Any check does not examine the type argument of a typeguard. An example is,
def foo(x: object) -> TypeGuard[Any]:
...
when run with mypy --disallow-explicit-any raises no error.
Expected Behavior
I would expect 1 type error on the function definition line.
Your Environment
Using master mypy.
I'm debugging this as the issue was brought up in this pr, that TypeGuardType currently does not implement accept. If it did check TypeGuard type for explicit Any it would end up crashing. So there's two fixes needed here, 1. Check typeguard argument, and 2. Add an accept.
The function signature is checked for Any, but it happens after normalization of typeguard to bool. By the time the Any check occurs on this line while the function signature looks like this,
def (_mypy_marker: Union[builtins.int, builtins.str]) -> TypeGuard[Any]
but if you check ret_type of typ object it shows bool.
My guess is a fix could be done around here,
Line 591 in 619d9bd