mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
lambda: do not start inference from void type (IDEA-127596)
This commit is contained in:
+1
-1
@@ -379,7 +379,7 @@ public class InferenceSession {
|
||||
PsiType returnType = method.getReturnType();
|
||||
if (!PsiType.VOID.equals(returnType) && returnType != null) {
|
||||
PsiType targetType = getTargetType(context);
|
||||
if (targetType != null) {
|
||||
if (targetType != null && !PsiType.VOID.equals(targetType)) {
|
||||
registerReturnTypeConstraints(PsiUtil.isRawSubstitutor(method, mySiteSubstitutor) ? returnType : mySiteSubstitutor.substitute(returnType), targetType);
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Executor<E> {
|
||||
<K> void bar(Executor<K> e) {
|
||||
Runnable r = () -> foo(e);
|
||||
}
|
||||
|
||||
private <T> T foo(final Executor<T> e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+4
@@ -88,6 +88,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA126109() { doTest(); }
|
||||
public void testIDEA126809() { doTest(); }
|
||||
|
||||
public void testIDEA127596() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user