Annotations on generic constructors

John Spicer jhs at
Thu May 1 14:32:35 UTC 2014

javac accepts this usage:

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@interface T { }
class X {
  <P> @T X() { }

but that seems to be prohibited by the constructor declaration syntax, which only allows annotations before the TypeParameters.

Should this case be rejected?

John Spicer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list