mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +07:00
inference: traverse to parent to get cached target type
GitOrigin-RevId: fb048adc50d2d112b951c87c0e6cf6f5fadc66a2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3e93a223e4
commit
7a61cdc1b7
@@ -360,7 +360,7 @@ public class LambdaUtil {
|
||||
|
||||
final Map<PsiElement, PsiType> map = ourFunctionTypes.get();
|
||||
if (map != null) {
|
||||
final PsiType type = map.get(expression);
|
||||
final PsiType type = ObjectUtils.chooseNotNull(map.get(expression), map.get(element));
|
||||
if (type != null) {
|
||||
return type;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
class Foo<T> {
|
||||
public Foo(Predicate<T> p) {
|
||||
}
|
||||
|
||||
void m(Predicate<String> p){
|
||||
new Foo<>(p == null ? null : acc -> p.test<error descr="'test(java.lang.String)' in 'java.util.function.Predicate' cannot be applied to '(java.lang.Object)'">(acc)</error>);
|
||||
new Foo<>(acc -> p.test<error descr="'test(java.lang.String)' in 'java.util.function.Predicate' cannot be applied to '(java.lang.Object)'">(acc)</error>);
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
public void testClsCapturedReturnTypes() { doTest(); }
|
||||
public void testOverloadChooserOfReturnType() { doTest(); }
|
||||
public void testIDEA98866() { doTest(); }
|
||||
public void testDiamondWithConditionalInside() { doTest(); }
|
||||
public void testIncompleteSubstitution() { doTest(); }
|
||||
public void testJDK8028774() { doTest(); }
|
||||
public void testErasedByReturnConstraint() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user