RFR: 8286057: Make javac error on a generic enum friendlier [v2]

Pavel Rappo prappo at openjdk.java.net
Fri May 13 10:19:49 UTC 2022


On Thu, 12 May 2022 18:06:23 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

>> Improves the error message for generic enumerations.
>
> Aggelos Biboudis has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   8286057: Make javac error on a generic enum friendlier

Thanks for doing this! I only note that the caret `^` is a bit off as opposed to the case of a generic annotation.

Compare:

$ cat X.java 
public enum X<T> {}
$ javac X.java 
X.java:1: error: enums cannot be generic
public enum X<T> {}
                ^


$ cat Y.java 
@interface Y<T> {}
$ ./build/macosx-x64/images/jdk/bin/javac Y.java 
Y.java:1: error: annotation interface Y cannot be generic
@interface Y<T> {}
             ^
1 error

-------------

PR: https://git.openjdk.java.net/jdk/pull/8677


More information about the compiler-dev mailing list