void () { myFixture.configureByText("Test.java", """ import java.util.List; interface I<A, B> {} record R<T>(T t) implements I<T, T> {} class X { void test(I<String, String> obj) { if (obj instanceof R(var s)) { s.trim(); } } void test2(I<String, Integer> obj) { if (obj instanceof <error descr="Cannot infer pattern type: Incompatible equality constraint: String and Integer">R</error>(var s)) { s.<error descr="Cannot resolve method 'trim' in 'T'">trim</error>(); } } } """); myFixture.checkHighlighting(); }