void () { doTest("Union[C1, C2]", """ class C1: def __getitem__(self, item): return self class C2: def __getitem__(self, item): return self def f(): ''' :rtype: C1 | C2 ''' pass expr = f()[0] print(expr) """); }