mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
method refs: allow reference parameters before method name
This commit is contained in:
@@ -1265,7 +1265,7 @@ public class GenericsHighlightUtil {
|
||||
final PsiElement parent = refParamList.getParent();
|
||||
if (parent instanceof PsiReferenceExpression) {
|
||||
final PsiElement grandParent = parent.getParent();
|
||||
if (!(grandParent instanceof PsiMethodCallExpression)) {
|
||||
if (!(grandParent instanceof PsiMethodCallExpression) && !(parent instanceof PsiMethodReferenceExpression)) {
|
||||
final String message = JavaErrorMessages.message("generics.reference.parameters.not.allowed");
|
||||
return HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, refParamList, message);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class MyTest {
|
||||
interface I<X> {
|
||||
X _();
|
||||
}
|
||||
static <T> T bar() {return null;}
|
||||
static {
|
||||
I i = MyTest::<String>bar;
|
||||
}
|
||||
}
|
||||
@@ -73,6 +73,10 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReferenceParameters() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user