Skip to content

Commit 82239f4

Browse files
committed
chore: introduce scala.annotation.documented
1 parent be6163f commit 82239f4

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
@@ -20,4 +20,6 @@ import scala.annotation.meta.*
2020
* class fields. But it is checked that the field is eliminated before code
2121
* is generated.
2222
*/
23-
@param @field class constructorOnly extends scala.annotation.StaticAnnotation
23+
@param @field
24+
@documented
25+
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
@@ -5,5 +5,6 @@ package scala.annotation
55
* @see [[https://dotty.epfl.ch/docs/reference/other-new-features/experimental-defs]]
66
* @syntax markdown
77
*/
8+
@documented
89
final class experimental(message: String) extends StaticAnnotation:
910
def this() = this("")

library/src/scala/annotation/static.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ import scala.annotation.meta.*
1010
@beanSetter
1111
@param
1212
@setter
13+
@documented
1314
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
@@ -5,4 +5,5 @@ package scala.annotation
55
* definition, its implementation will use the name `extname` instead of
66
* the regular name.
77
*/
8+
@documented
89
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
@@ -4,4 +4,5 @@ package scala.annotation
44
* When this annotation is used, the initialization of the lazy val will use a
55
* faster mechanism which is not thread-safe.
66
*/
7+
@documented
78
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
@@ -1,7 +1,7 @@
11
package scala
22
package caps
33

4-
import annotation.{experimental, compileTimeOnly, retainsCap}
4+
import annotation.{experimental, documented, compileTimeOnly, retainsCap}
55

66
/**
77
* Base trait for classes that represent capabilities in the
@@ -117,10 +117,10 @@ final class reserve extends annotation.StaticAnnotation
117117
/** Allowed only for source versions up to 3.7:
118118
* An annotation on parameters `x` stating that the method's body makes
119119
* use of the reach capability `x*`. Consequently, when calling the method
120-
* we need to charge the deep capture set of the actual argiment to the
120+
* we need to charge the deep capture set of the actual argument to the
121121
* environment.
122122
*/
123-
@experimental
123+
@experimental @documented
124124
final class use extends annotation.StaticAnnotation
125125

126126
/** 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)