Records: report canonical constructor parameter name mismatch (IDEA-228460)

GitOrigin-RevId: d2c5c75f2a9066bd949ad503ad6fcbd71c594d18
This commit is contained in:
Tagir Valeev
2019-12-26 06:03:46 +00:00
committed by intellij-monorepo-bot
parent 9f7fd6f214
commit 20b13c9122
6 changed files with 50 additions and 21 deletions
@@ -15,6 +15,12 @@ record TypeMismatch<T>(T t) {
this.t = null;
}
}
record NameMismatch(int x, int y) {
public NameMismatch(int <error descr="Canonical constructor parameter names must match record component names. Expected: 'x', found: '_x'">_x</error>, int <error descr="Canonical constructor parameter names must match record component names. Expected: 'y', found: '_y'">_y</error>) {
x = _x;
y = _y;
}
}
// Current spec draft allows this
record VarArgMismatch(int... x) {
public VarArgMismatch(int[] x) {