New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to annotate a package #3600
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3600?orig=1 |
Gabriel Rossetti (grossetti) said: |
@paulp said: |
Nathan Stoddard (nstoddard) said: |
@gzm0 said: |
@xeno-by said: |
@gzm0 said: |
No one mentioned that this duplicates #3115 with possibly upping the ante on java interop. |
Scala does not have any way of placing annotations on a package.
In Java, package annotations are placed before the
package
statement in a Java source file namedpackage-info.java
. The compiler generates an interface namedpackage-info
and attaches those annotations to it. These annotations (if they have a retention policy ofRUNTIME
) can then be looked at with some methods onjava.lang.Package
.See also: [http://java.sun.com/docs/books/jls/third_edition/html/packages.htmlSI-7.4.1.1 JLS 3rd Ed. � 7.4.1.1]
The most obvious syntax for this is to allow annotations on package objects. This might result in confusion, though, since package objects have their own, distinct class files.
The text was updated successfully, but these errors were encountered: