Skip to content

Commit 02fab3f

Browse files
committed
chore: introduce scala.annotation.documented
1 parent aae5acb commit 02fab3f

File tree

14 files changed

+44
-29
lines changed

14 files changed

+44
-29
lines changed

library/src/scala/annotation/constructorOnly.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ import scala.annotation.meta.*
2222
* class fields. But it is checked that the field is eliminated before code
2323
* is generated.
2424
*/
25-
@param @field class constructorOnly extends scala.annotation.StaticAnnotation
25+
@param @field
26+
@documented
27+
class constructorOnly extends scala.annotation.StaticAnnotation
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package scala.annotation
2+
3+
// TODO: Write the actual scaladoc of this annotation
4+
5+
// The annotation from Java is a simple hack as both have the same semantic
6+
// meaning, only this one should be used by Scala code and the second
7+
// annotation by Java Code
8+
// @documented (TODO: can we make it work without breaking the cycle detection algorithm?)
9+
@java.lang.annotation.Documented
10+
final class documented extends StaticAnnotation

library/src/scala/annotation/experimental.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ import language.experimental.captureChecking
77
* @see [[https://dotty.epfl.ch/docs/reference/other-new-features/experimental-defs]]
88
* @syntax markdown
99
*/
10+
@documented
1011
final class experimental(message: String) extends StaticAnnotation:
1112
def this() = this("")

library/src/scala/annotation/static.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ import scala.annotation.meta.*
1212
@beanSetter
1313
@param
1414
@setter
15+
@documented
1516
final class static extends StaticAnnotation

library/src/scala/annotation/targetName.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ import language.experimental.captureChecking
77
* definition, its implementation will use the name `extname` instead of
88
* the regular name.
99
*/
10+
@documented
1011
final class targetName(name: String) extends StaticAnnotation

library/src/scala/annotation/threadUnsafe.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ import language.experimental.captureChecking
66
* When this annotation is used, the initialization of the lazy val will use a
77
* faster mechanism which is not thread-safe.
88
*/
9+
@documented
910
final class threadUnsafe extends StaticAnnotation

library/src/scala/annotation/varargs.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ import scala.language.`2.13`
1818
* Java varargs-style forwarder method for interop. This annotation can
1919
* only be applied to methods with repeated parameters.
2020
*/
21+
@documented
2122
final class varargs extends scala.annotation.StaticAnnotation

library/src/scala/caps/package.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package caps
33

44
import language.experimental.captureChecking
55

6-
import annotation.{experimental, compileTimeOnly, retainsCap}
6+
import annotation.{experimental, documented, compileTimeOnly, retainsCap}
77

88
/**
99
* Base trait for classes that represent capabilities in the
@@ -119,10 +119,10 @@ final class reserve extends annotation.StaticAnnotation
119119
/** Allowed only for source versions up to 3.7:
120120
* An annotation on parameters `x` stating that the method's body makes
121121
* use of the reach capability `x*`. Consequently, when calling the method
122-
* we need to charge the deep capture set of the actual argiment to the
122+
* we need to charge the deep capture set of the actual argument to the
123123
* environment.
124124
*/
125-
@experimental
125+
@experimental @documented
126126
final class use extends annotation.StaticAnnotation
127127

128128
/** A trait that used to allow expressing existential types. Replaced by

library/src/scala/specialized.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ package scala
1414

1515
import scala.language.`2.13`
1616

17+
import scala.annotation.documented
18+
1719
import Specializable._
1820

1921
/** Annotate type parameters on which code should be automatically
@@ -30,6 +32,7 @@ import Specializable._
3032
*/
3133
// class tspecialized[T](group: Group[T]) extends scala.annotation.StaticAnnotation {
3234

35+
@documented
3336
final class specialized(group: SpecializedGroup) extends scala.annotation.StaticAnnotation {
3437
def this(types: Specializable*) = this(new Group(types.toList))
3538
def this() = this(Primitives)

library/src/scala/throws.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ package scala
1414

1515
import scala.language.`2.13`
1616

17+
import scala.annotation.documented
18+
1719
/**
1820
* Annotation for specifying the exceptions thrown by a method.
1921
* For example:
@@ -25,6 +27,7 @@ import scala.language.`2.13`
2527
* }
2628
* }}}
2729
*/
30+
@documented
2831
final class throws[T <: Throwable](cause: String = "") extends scala.annotation.StaticAnnotation {
2932
def this(clazz: Class[T]) = this("")
3033
}

0 commit comments

Comments
 (0)