It is not currently possible to specify the transformation of the form D → T, where D is any dataclass. Structural subtyping might help; otherwise, we will have to create a special case, like a specialized protocol inside the library itself which only serves as a convenience.
Relevant: python/mypy#6568