Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/IncludeConstraintsWhenParentMethodIsDuringCalculation.java
Tagir Valeev 5b5abb8e13 [java-highlighting] Lambda-related type errors migrated
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 1fb0b4c35b4db63d8c15cb392098380d1014ebf2
2025-02-04 09:52:02 +00:00

15 lines
489 B
Java

class Test {
static class SuperFoo<X> {}
static class Foo<X extends Number> extends SuperFoo<X> {}
interface I<Y> {
SuperFoo<Y> m();
}
<R> SuperFoo<R> foo(I<R> ax) { return null; }
SuperFoo<String> ls = <error descr="Incompatible types. Found: 'Test.SuperFoo<java.lang.Number>', required: 'Test.SuperFoo<java.lang.String>'">foo</error>(() -> new Foo<>());
SuperFoo<Integer> li = foo(() -> new Foo<>());
SuperFoo<?> lw = foo(() -> new Foo<>());
}