reverted java highlighting: give up check of @PolymorphicSignature methods (IDEA-251449)

appeared to be a javac bug

GitOrigin-RevId: 1d17221830606f5bdc8d0db78fa97f94e9548799
This commit is contained in:
Anna Kozlova
2020-10-06 14:40:01 +02:00
committed by intellij-monorepo-bot
parent c8fe5a1584
commit 9355c487e2
2 changed files with 1 additions and 8 deletions

View File

@@ -1,7 +1,6 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi;
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.core.JavaPsiBundle;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.NlsContexts;
@@ -163,12 +162,6 @@ public final class PsiMethodReferenceUtil {
return false;
}
PsiElement element = result.getElement();
if (element instanceof PsiMethod &&
AnnotationUtil.isAnnotated(((PsiMethod)element), CommonClassNames.JAVA_LANG_INVOKE_MH_POLYMORPHIC, 0)) {
return true;
}
if (TypeConversionUtil.isAssignable(interfaceReturnType, methodReturnType)) {
return true;
}

View File

@@ -2,7 +2,7 @@ import java.lang.invoke.MethodHandle;
class MyTest {
private void m(MethodHandle handle) {
I stringSupplier = handle::invokeExact;
I stringSupplier = <error descr="Bad return type in method reference: cannot convert java.lang.Object to java.lang.String">handle::invokeExact</error>;
}
}
interface I {