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:
Tagir Valeev
2020-01-03 12:03:57 +00:00
committed by intellij-monorepo-bot
parent acffc2bef9
commit 5766652109
2 changed files with 2 additions and 8 deletions
@@ -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;
}
}