Annotations on generic constructors

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


javac accepts this usage:

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE_USE)
@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: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20140501/09c8df72/attachment.html>


More information about the compiler-dev mailing list