-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: None
-
Component/s: tools
-
b11
javac generates spurious error messages for this test case:
record R(){
public R throws Exception {}
}
R.java:2: error: <identifier> expected
public R throws Exception {}
^
R.java:2: error: field declaration must be static
public R throws Exception {}
^
(consider replacing field with record component)
R.java:2: error: invalid method declaration; return type required
public R throws Exception {}
^
Note: R.java uses preview language features.
Note: Recompile with -Xlint:preview for details.
3 errors
a better error message should be generated
record R(){
public R throws Exception {}
}
R.java:2: error: <identifier> expected
public R throws Exception {}
^
R.java:2: error: field declaration must be static
public R throws Exception {}
^
(consider replacing field with record component)
R.java:2: error: invalid method declaration; return type required
public R throws Exception {}
^
Note: R.java uses preview language features.
Note: Recompile with -Xlint:preview for details.
3 errors
a better error message should be generated