Skip to content

Commit 2de6f93

Browse files
committed
Add support for user-defined annotation subclasses
This adds infrastructure so that the compiler or compiler plugins can support user-defined annotation subclasses.
1 parent 0fa510a commit 2de6f93

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc. dba Akka
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
13+
package scala.annotation
14+
package meta
15+
16+
/**
17+
* This internal annotation encodes arguments passed to annotation superclasses. Example:
18+
*
19+
* {{{
20+
* class a(x: Int) extends Annotation
21+
* class b extends a(42) // the compiler adds `@superArg("x", 42)` to class b
22+
* }}}
23+
*/
24+
class superArg(p: String, v: Any) extends StaticAnnotation
25+
26+
/**
27+
* This internal annotation encodes arguments passed to annotation superclasses. Example:
28+
*
29+
* {{{
30+
* class a(x: Int) extends Annotation
31+
* class b(y: Int) extends a(y) // the compiler adds `@superFwdArg("x", "y")` to class b
32+
* }}}
33+
*/
34+
class superFwdArg(p: String, n: String) extends StaticAnnotation

0 commit comments

Comments
 (0)