Skip to content

No way to annotate a package #3600

Open
@scabug

Description

@scabug

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 named package-info.java. The compiler generates an interface named package-info and attaches those annotations to it. These annotations (if they have a retention policy of RUNTIME) can then be looked at with some methods on java.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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions