-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
None
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Ubuntu 22.04.2 LTS
openjdk version "20-internal" 2023-03-21
OpenJDK Runtime Environment (build 20-internal-adhoc.admin1.jdk-jdk-20-34)
OpenJDK 64-Bit Server VM (build 20-internal-adhoc.admin1.jdk-jdk-20-34, mixed mode)
A DESCRIPTION OF THE PROBLEM :
The error message that occurs when the default constructor of a record needs to be called is a bit unclear, especially since many developers don't know what a canonical constructor is. The error message just states: constructor is not canonical, so its first statement must invoke another constructor of class...
It would be good to improve the error message, for example, by mentioning that just this(...) should be added to the first line of the constructor. Here is example code that illustrates how the error message is produced.
public record Record1(int a){
public Record1(int a, int b){}
}
Ubuntu 22.04.2 LTS
openjdk version "20-internal" 2023-03-21
OpenJDK Runtime Environment (build 20-internal-adhoc.admin1.jdk-jdk-20-34)
OpenJDK 64-Bit Server VM (build 20-internal-adhoc.admin1.jdk-jdk-20-34, mixed mode)
A DESCRIPTION OF THE PROBLEM :
The error message that occurs when the default constructor of a record needs to be called is a bit unclear, especially since many developers don't know what a canonical constructor is. The error message just states: constructor is not canonical, so its first statement must invoke another constructor of class...
It would be good to improve the error message, for example, by mentioning that just this(...) should be added to the first line of the constructor. Here is example code that illustrates how the error message is produced.
public record Record1(int a){
public Record1(int a, int b){}
}