[java-psi] One more test for lambda parameter type under ambiguous resolve

GitOrigin-RevId: 41a80dd4ce9f232d6e5cc273adc8f02dd1a01780
This commit is contained in:
Tagir Valeev
2025-03-26 18:21:27 +00:00
committed by intellij-monorepo-bot
parent 98de135081
commit f6b5d7935a
2 changed files with 18 additions and 0 deletions
@@ -0,0 +1,17 @@
import java.util.function.Function;
import java.util.function.ToIntFunction;
import java.util.function.ToLongFunction;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
interface Test {
default IntStream distinct2(Stream<String> s) {
return s.map<error descr="Ambiguous method call: both 'Stream.map(Function<? super String, ?>)' and 'Stream.map(ToIntFunction<? super String>)' match">(i -> i.length())</error>;
}
}
interface Stream<T> {
<R> Stream<R> map(Function<? super T, ? extends R> mapper);
IntStream map(ToIntFunction<? super T> mapper);
LongStream map(ToLongFunction<? super T> mapper);
}
@@ -151,6 +151,7 @@ class NewLambdaHighlightingTest extends LightJavaCodeInsightFixtureTestCase5 {
@Test void testLambdaWithExplicitTypeAndTargetTypeParameter() { doTest(); }
@Test void testAmbiguousConstructorCallWithLambdaInside() { doTest(); }
@Test void testMultiResolveSameFunction() {doTest();}
@Test void testMultiResolveThreeFunctions() {doTest();}
@Test void testWrongTargetTypeDoNotReportIncompatibleTypeInside() {doTest();}
@Override