void () { doTest("Union[A, B]", """ from typing import TypeVar, Type T = TypeVar('T') class Base: @classmethod def factory(cls: Type[T]) -> T: pass class A(Base): pass class B(Base): pass expr = (A or B).factory()"""); }