Mypy generates a false positive with the following code.
from collections.abc import Callable
from typing import TypeVar
T = TypeVar("T")
def foo(obj: T | Callable[..., T]) -> None:
match obj:
case Callable() as func: # error: Expected type in class pattern; found "typing._SpecialForm"
func()
FWIW, pyright was also not handling this case correctly.