mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Records: consider varargness mismatch as compilation error
There's an agreement to do this in expert group -- see http://mail.openjdk.java.net/pipermail/amber-spec-experts/2019-December/001889.html GitOrigin-RevId: 8fc465ece0b9c4bb1517793a60cabab34933b688
This commit is contained in:
committed by
intellij-monorepo-bot
parent
acffc2bef9
commit
5766652109
-6
@@ -1961,12 +1961,6 @@ public class HighlightMethodUtil {
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
PsiType componentType = components[i].getType();
|
||||
PsiType parameterType = parameters[i].getType();
|
||||
if (componentType instanceof PsiEllipsisType) {
|
||||
componentType = ((PsiEllipsisType)componentType).toArrayType();
|
||||
}
|
||||
if (parameterType instanceof PsiEllipsisType) {
|
||||
parameterType = ((PsiEllipsisType)parameterType).toArrayType();
|
||||
}
|
||||
String componentName = components[i].getName();
|
||||
String parameterName = parameters[i].getName();
|
||||
if (!parameterType.equals(componentType)) {
|
||||
|
||||
+2
-2
@@ -23,12 +23,12 @@ record NameMismatch(int x, int y) {
|
||||
}
|
||||
// Current spec draft allows this
|
||||
record VarArgMismatch(int... x) {
|
||||
public VarArgMismatch(int[] x) {
|
||||
public VarArgMismatch(<error descr="Incorrect parameter type for record component 'x'. Expected: 'int...', found: 'int[]'">int[]</error> x) {
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
record VarArgMismatch2(int[] x) {
|
||||
public VarArgMismatch2(int... x) {
|
||||
public VarArgMismatch2(<error descr="Incorrect parameter type for record component 'x'. Expected: 'int[]', found: 'int...'">int...</error> x) {
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user