void () { runWithLanguageLevel(LanguageLevel.PYTHON39, () -> { doTestByText(""" from typing import Optional class A: pass assert isinstance(A(), <error descr="'Optional' cannot be used with instance and class checks">Optional</error>) B = Optional assert issubclass(A, <error descr="'Optional' cannot be used with instance and class checks">B</error>) assert isinstance(A(), <error descr="'Optional' cannot be used with instance and class checks">Optional[int]</error>) assert issubclass(A, <error descr="'Optional' cannot be used with instance and class checks">B[int]</error>) C = B[int] assert issubclass(A, <error descr="'Optional' cannot be used with instance and class checks">C</error>)"""); }); }