void () { doTestByText(""" from typing import Self, Callable class MyClass: def foo(self, bar: Self | None | int) -> None: ... class SubClass(MyClass): pass myClass = MyClass() subClass = SubClass() myClass.foo(myClass) myClass.foo(subClass) myClass.foo(42) myClass.foo(None) myClass.foo(<warning descr="Expected type 'MyClass | None | int' (matched generic type 'Self | None | int'), got 'str' instead">""</warning>) subClass.foo(<warning descr="Expected type 'SubClass | None | int' (matched generic type 'Self | None | int'), got 'MyClass' instead">myClass</warning>) subClass.foo(subClass) subClass.foo(42) subClass.foo(None) subClass.foo(<warning descr="Expected type 'SubClass | None | int' (matched generic type 'Self | None | int'), got 'str' instead">""</warning>)"""); }