https://mypy-play.net/?mypy=1.18.2&python=3.12&gist=2e756ebb6f05cb8ef01bcc4cb504c147
def get[D: dict[str, object]](arg: D, /) -> D:
return arg
reveal_type(get({})) # N: Revealed type is "builtins.dict[Never, Never]"
This is incorrect, since dict[Never, Never] is not a subtype of dict[str, object]. The solution should have key type str (or Any), but not Never.
See Also: #19641, but this was closed since the caching part of the problem was addressed