mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
lambda: proceed c-like arrays declarations in parameters for lambda with excplicit type declarations (IDEA-152690)
This commit is contained in:
@@ -214,7 +214,7 @@ public class PsiLambdaExpressionImpl extends ExpressionPsiElement implements Psi
|
||||
PsiParameter parameter = lambdaParameters[lambdaParamIdx];
|
||||
final PsiTypeElement typeElement = parameter.getTypeElement();
|
||||
if (typeElement != null) {
|
||||
final PsiType lambdaFormalType = toArray(typeElement.getType());
|
||||
final PsiType lambdaFormalType = toArray(parameter.getType());
|
||||
final PsiType methodParameterType = toArray(parameterTypes[lambdaParamIdx]);
|
||||
if (!lambdaFormalType.equals(methodParameterType)) {
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
interface X {
|
||||
void foo(int[] x);
|
||||
}
|
||||
|
||||
class C {
|
||||
static void main(String[] args){
|
||||
X a = (int x[]) -> { };
|
||||
}
|
||||
}
|
||||
@@ -276,6 +276,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCLikeArrayDeclarationInLambdaWithExplicitTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user