mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
method refs: return type check fix for raw constructor (IDEA-142302)
This commit is contained in:
@@ -325,7 +325,7 @@ public class PsiMethodReferenceUtil {
|
||||
if (methodReturnType == null) {
|
||||
methodReturnType = JavaPsiFacade.getElementFactory(expression.getProject()).createType(containingClass, subst);
|
||||
}
|
||||
if (!TypeConversionUtil.isAssignable(interfaceReturnType, methodReturnType, false)) {
|
||||
if (!TypeConversionUtil.isAssignable(interfaceReturnType, methodReturnType)) {
|
||||
return "Bad return type in method reference: cannot convert " + methodReturnType.getCanonicalText() + " to " + interfaceReturnType.getCanonicalText();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ class Test<T> {
|
||||
}
|
||||
|
||||
{
|
||||
Callable<Test<String>> c = <error descr="Bad return type in method reference: cannot convert Test to Test<java.lang.String>">Test::<String>new</error>;
|
||||
Callable<Test<String>> c = <error descr="Raw constructor reference with explicit type parameters for constructor">Test::<String>new</error>;
|
||||
Callable<Test<String>> c1 = Test<String>::<String>new;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user