Skip to content

Commit 8a3239c

Browse files
Merge remote-tracking branch 'origin/dev' into dev
2 parents 3d984f7 + 1b6876d commit 8a3239c

File tree

3 files changed

+56
-50
lines changed

3 files changed

+56
-50
lines changed

docs/src/md/kotlin.core/annotations.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Values of annotation types cannot be created directly, but can be operated on wh
77
### Annotation values
88

99
An annotation value is a value of a special [annotation type][Annotation declarations].
10-
An annotation type is a special kind of class type which is allowed to include properties of the following types:
10+
An annotation type is a special kind of class type which is allowed to include read-only properties of the following types:
1111

1212
- [Integer types][Built-in integer types];
1313
- [Enum types][Enum class declaration];
@@ -16,24 +16,24 @@ An annotation type is a special kind of class type which is allowed to include p
1616
- [Arrays][Array types] of any type listed above.
1717

1818
Annotation classes are not allowed to have any member functions, constructors or mutable properties.
19-
They are also not allowed to have base classes and are considered to be implicitly derived from `kotlin.Annotation`.
19+
They are also not allowed to have declared supertypes and are considered to be implicitly derived from `kotlin.Annotation`.
2020

2121
### Annotation retention
2222

23-
The retention level of an annotation declares which compilation artifacts a particular compiler on a particular platform *retain* this kind of annotation.
23+
The retention level of an annotation declares which compilation artifacts (for a particular compiler on a particular platform) *retain* this kind of annotation.
2424
There are the following types of retention available:
2525

2626
- Source retention (accessible by source-processing tools);
2727
- Binary retention (retained in compilation artifacts);
2828
- Runtime retention (accessible at runtime).
2929

30-
Each subsequent level inherits what is accessible on the previous levels.
30+
> Each subsequent level inherits what is accessible on the previous levels.
3131
32-
For availability and particular ways of accessing the metadata specified by these annotations please refer to the corresponding platforms' documentation.
32+
For availability and particular ways of accessing the metadata specified by these annotations please refer to the corresponding platform-specific documentation.
3333

3434
### Annotation targets
3535

36-
The *targets* of a particular type of annotations is the kind of program entity which this annotations may be placed on.
36+
The *target* of a particular type of annotations is the kind of program entity which this annotations may be placed on.
3737
There are the following targets available:
3838

3939
- A [class declaration][Class declaration] (including annotation classes);
@@ -65,27 +65,33 @@ TODO(Anything else?)
6565

6666
* `kotlin.annotation.Retention`
6767

68-
`kotlin.annotation.Retention` is an annotation that is only used in annotation classes to specify annotation retention.
68+
`kotlin.annotation.Retention` is an annotation which is only used on annotation classes to specify their annotation retention level.
6969
It has the following single field:
70-
```kotlin
71-
val value: AnnotationRetention = AnnotationRetention.RUNTIME
72-
```
70+
71+
* ```kotlin
72+
val value: AnnotationRetention = AnnotationRetention.RUNTIME
73+
```
74+
75+
The retention level of the annotated annotation.
7376

74-
`kotlin.annotation.AnnotationRetention` is an enum class with the following values (see [annotation targets section][Annotation targets] for details):
77+
`kotlin.annotation.AnnotationRetention` is an enum class with the following values (see [Annotation retention section][Annotation retention] for details):
7578

7679
* `SOURCE`;
7780
* `BINARY`;
7881
* `RUNTIME`.
7982

8083
* `kotlin.annotation.Target`
8184

82-
`kotlin.annotation.Target` is an annotation that is only used in annotation classes to specify targets this annotation is valid for.
85+
`kotlin.annotation.Target` is an annotation which is only used on annotation classes to specify targets those annotations are valid for.
8386
It has the following single field:
84-
```kotlin
85-
vararg val allowedTargets: AnnotationTarget
86-
```
8787

88-
`kotlin.annotation.AnnotationTarget` is an enum class with the following values (see [annotation retention section][Annotation retention] for details):
88+
* ```kotlin
89+
vararg val allowedTargets: AnnotationTarget
90+
```
91+
92+
The allowed annotation targets of the annotated annotation.
93+
94+
`kotlin.annotation.AnnotationTarget` is an enum class with the following values (see [Annotation targets section][Annotation targets] for details):
8995

9096
* `CLASS`;
9197
* `ANNOTATION_CLASS`;
@@ -105,7 +111,7 @@ TODO(Anything else?)
105111

106112
* `kotlin.annotation.Repeatable`
107113

108-
`kotlin.annotation.Repeatable` is an annotation that is only used in annotation classes to specify whether this particular annotation is repeatable.
114+
`kotlin.annotation.Repeatable` is an annotation which is only used on annotation classes to specify whether this particular annotation is repeatable.
109115
Annotations are non-repeatable by default.
110116

111117
* `kotlin.Experimental` / `kotlin.UseExperimental`
@@ -116,22 +122,23 @@ TODO(Anything else?)
116122
val level: Level = Level.ERROR
117123
```
118124

119-
The severity level of the experimental status with two values: `Level.WARNING` and `Level.ERROR`
125+
The severity level of the experimental status with two possible values: `Level.WARNING` and `Level.ERROR`.
120126

121127
This annotation is used to introduce implementation-defined experimental language or standard library features.
128+
122129
`kotlin.UseExperimental` is an annotation class with a single field:
123130

124131
* ```kotlin
125132
vararg val markerClass: KClass<out Annotation>
126133
```
127134

128-
The classes this annotation is allowing to use
135+
The classes which this annotation allows to use.
129136

130-
This annotation is used to explicitly mark declarations that use experimental features marked by `kotlin.Experimental` .
137+
This annotation is used to explicitly mark declarations which use experimental features marked by `kotlin.Experimental`.
131138

132-
It is implementation-defined on how these annotations are processed.
139+
It is implementation-defined how this annotation is processed.
133140

134-
TODO(experimental status is still experimental itself)
141+
TODO(Experimental status is still experimental itself)
135142

136143
* `kotlin.Deprecated` / `kotlin.ReplaceWith`
137144

@@ -141,19 +148,19 @@ TODO(Anything else?)
141148
val message: String
142149
```
143150

144-
The message supporting the deprecation
151+
A message supporting the deprecation.
145152

146153
* ```kotlin
147154
val replaceWith: ReplaceWith = ReplaceWith("")
148155
```
149156

150-
An optional replacement for deprecated code
157+
An optional replacement for the deprecated code.
151158

152159
* ```kotlin
153160
val level: DeprecationLevel = DeprecationLevel.WARNING
154161
```
155162

156-
The deprecation level
163+
The deprecation level with three possible values: `DeprecationLevel.WARNING`, `DeprecationLevel.ERROR` and `DeprecationLevel.HIDDEN`.
157164

158165
`kotlin.ReplaceWith` is itself an annotation class containing the information on how to perform the replacement in case it is provided.
159166
It has the following fields:
@@ -162,21 +169,19 @@ TODO(Anything else?)
162169
val expression: String
163170
```
164171

165-
The replacement code
172+
The replacement code.
166173

167174
* ```kotlin
168175
vararg val imports: String
169176
```
170177

171-
The array of imports needed for the replacement code to work correctly
178+
An array of imports needed for the replacement code to work correctly.
172179

173-
`kotlin.DeprecationLevel` is an enum class with three values: `WARNING`, `ERROR` and `HIDDEN`.
180+
`kotlin.Deprecated` is a built-in annotation supporting the deprecation cycle for declarations: marking some declarations as outdated, soon to be replaced with other declarations, or not recommended for use.
181+
It is implementation-defined how this annotation is processed, with the following recommendations:
174182

175-
`kotlin.Deprecated` is a builtin annotation supporting the deprecation cycle for declarations: marking that some declarations are outdated, soon to be replaced with other declarations or not recommended.
176-
It is implementation-defined how this annotation is handled, with the following recommendations:
177-
178-
* Attempting to use a declaration with deprecation level of `kotlin.DeprecationLevel.WARNING` should produce a compile-time warning;
179-
* Attempting to use a declaration with deprecation level of `kotlin.DeprecationLevel.ERROR` should produce a compile-time error.
183+
* Attempting to use a declaration with deprecation level of `DeprecationLevel.WARNING` should produce a compile-time warning;
184+
* Attempting to use a declaration with deprecation level of `DeprecationLevel.ERROR` should produce a compile-time error.
180185

181186
* `kotlin.Suppress`
182187

@@ -186,10 +191,10 @@ TODO(Anything else?)
186191
vararg val names: String
187192
```
188193

189-
The names of features this annotation is suppressing
194+
The names of features this annotation is suppressing.
190195

191196
`kotlin.Suppress` is used to optionally mark any piece of code as suppressing some language feature, such as a compiler warning, an IDE mechanism or a language feature.
192-
The names of features that one can suppress with this annotation is implementation-defined, as is the processing of this annotation itself.
197+
The names of features which one can suppress with this annotation are implementation-defined, as is the processing of this annotation itself.
193198

194199
* `kotlin.SinceKotlin`
195200

@@ -199,32 +204,27 @@ TODO(Anything else?)
199204
val version: String
200205
```
201206

202-
The version of Kotlin language
207+
The version of Kotlin language.
203208

204-
`kotlin.SinceKotlin` is used to mark that a specific declaration is only available since some particular version of the language and above it.
209+
`kotlin.SinceKotlin` is used to mark a declaration which is only available since a particular version of the language.
205210
These mostly refer to standard library declarations.
206-
It is implementation-defined how this annotations are processed.
211+
It is implementation-defined how this annotation is processed.
207212

208213
* `kotlin.UnsafeVariance`
209214

210-
`kotlin.UnsafeVariance` is an annotation class with no fields that is only applicable to types.
211-
Any declaration marked by this annotation explicitly states that the [variance][Type parameter variance] errors arising for this particular type are to be ignored by the compiler.
215+
`kotlin.UnsafeVariance` is an annotation class with no fields which is only applicable to types.
216+
Any type instance marked by this annotation explicitly states that the [variance][Type parameter variance] errors arising for this particular type instance are to be ignored by the compiler.
212217

213218
* `kotlin.DslMarker`
214219

215-
`kotlin.DslMarker` is an annotation class with no fields that is applicable only to other annotation classes.
220+
`kotlin.DslMarker` is an annotation class with no fields which is applicable only to other annotation classes.
216221
An annotation class annotated with `kotlin.DslMarker` is marked as a marker of a specific DSL (domain-specific language).
217222
Any type annotated with such a marker is said to belong to that specific DSL.
218223
This affects [overload resolution][Overload resolution] in the following way: no two implicit receivers with types belonging to the same DSL are available in the same scope.
219-
See [overload resolution section][Overload resolution] for details.
220-
221-
TODO(sync with receivers???)
224+
See [Overload resolution section][Receivers] for details.
222225

223226
* `kotlin.PublishedApi`
224227

225-
`kotlin.PublishedApi` is an annotation class with no fields that is applicable to any declarations.
226-
This may be applied to any declarations with `internal` visibility to be visible to `public` `inline` declarations.
227-
See [the visibility section][Declaration visibility] for details.
228-
229-
230-
228+
`kotlin.PublishedApi` is an annotation class with no fields which is applicable to any declaration.
229+
It may be applied to any declaration with `internal` visibility to make it available to `public` `inline` declarations.
230+
See [Declaration visibility section][Declaration visibility] for details.

docs/src/md/kotlin.core/builtins.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ This function is used to implement [comparison operators][Comparison expressions
271271
`kotlin.Function<out R>` is the base classifier type of all [function types][Function types].
272272
See the relevant section for details.
273273

274+
### Built-in annotation types
275+
276+
Kotlin has a number of built-in [annotation types][Annotations], which are covered in more detail [here][Built-in annotations].
277+
274278
### Reflection support builtin types
275279

276280
#### `kotlin.reflect.KClass`

docs/src/md/kotlin.core/overload-resolution.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ The available receivers are prioritized in the following way:
4040

4141
> Important: these rules mean implicit receivers are always totally ordered w.r.t. their priority, as no two implicit receivers can have the same priority.
4242
43+
> Important: DSL-specific annotations (marked with [`kotlin.DslMarker`][Built-in annotations] annotation) change the availability of implicit receivers in the following way: for all types marked with a particular DSL-specific annotation, only the highest priority implicit receiver is available in a given scope.
44+
4345
The implicit receiver having the highest priority is also called the _default implicit receiver_.
4446
The default implicit receiver is available in a scope as `this`.
4547
Other available receivers may be accessed using [labeled this-expressions][This-expressions].

0 commit comments

Comments
 (0)