void () { doTestByText(""" from typing import Union class A: pass assert isinstance(A(), <error descr="'Union' cannot be used with instance and class checks">Union</error>) B = Union assert issubclass(A, <error descr="'Union' cannot be used with instance and class checks">B</error>) assert isinstance(A(), Union[int, str]) assert issubclass(A, B[int, str]) C = B[int, str] assert issubclass(A, C) assert isinstance(A(), Union[str, Union[str, Union[list, dict]]]) assert isinstance(A(), Union[str, Union[str, Union[<error descr="Parameterized generics cannot be used with instance and class checks">list[int]</error>, dict]]]) assert isinstance(A(), int | str) assert isinstance(A(), int | <error descr="Parameterized generics cannot be used with instance and class checks">list[str]</error>) assert issubclass(A, int | str) assert issubclass(A, int | <error descr="Parameterized generics cannot be used with instance and class checks">list[str]</error>) """); }