-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b03
-
Verified
javac needs to show more information in error message for the following negative varargs test cases:
1. Misplaced ellipsis: void foo( String s, Object o... ) { }
2. Varargs is not the last argument: void foo(String... s, int i){}
As per Jon's review: In both cases, the dominant (first) error message is "')' expected". In both cases, the reality is the language allows any of ',', ')', or '[' there, and javac is wrong for not mentioning all of these possibilities.
Please refer to the attached test cases and the current corresponding .out files.
1. Misplaced ellipsis: void foo( String s, Object o... ) { }
2. Varargs is not the last argument: void foo(String... s, int i){}
As per Jon's review: In both cases, the dominant (first) error message is "')' expected". In both cases, the reality is the language allows any of ',', ')', or '[' there, and javac is wrong for not mentioning all of these possibilities.
Please refer to the attached test cases and the current corresponding .out files.
- blocks
-
JDK-8030009 Analyze and move javac/varargs negative tests for colocation
-
- Closed
-
- relates to
-
JDK-8031383 Error recovery in JavacParser could be improved
-
- Closed
-