[java-highlighting] Do not report lambda return value error if its return type contains unsubstituted type variable

Fixes IDEA-310129 IDE hint a wrong position of Java method param compile error
Also: AdaptExpressionTypeFixUtil: try to determine wrong parameter even if several parameter types mention type parameter
Also: AdaptExpressionTypeFixUtil: new type mismatch fix to replace call with qualifier

GitOrigin-RevId: fbc63c0eb3415983ccf52ed5ade15b5895b65b21
This commit is contained in:
Tagir Valeev
2023-01-13 13:33:54 +01:00
committed by intellij-monorepo-bot
parent 099b26f082
commit b2dfb4c8a8
10 changed files with 168 additions and 19 deletions

View File

@@ -0,0 +1,13 @@
// "Replace 3rd argument with qualifier" "true-preview"
import java.util.function.Predicate;
import java.util.function.Supplier;
class X {
public static String getOrDefault(String prefer, Supplier<String> def) {
return getOrDefault(() -> prefer, String::isEmpty, def);
}
public static <T> T getOrDefault(Supplier<T> prefer, Predicate<T> abandon, Supplier<T> def) {
return null;
}
}

View File

@@ -0,0 +1,13 @@
// "Replace 3rd argument with qualifier" "true-preview"
import java.util.function.Predicate;
import java.util.function.Supplier;
class X {
public static String getOrDefault(String prefer, Supplier<String> def) {
return getOrDefault(() -> prefer, String::isEmpty, def<caret>.get());
}
public static <T> T getOrDefault(Supplier<T> prefer, Predicate<T> abandon, Supplier<T> def) {
return null;
}
}