Docs: improve code formatting in PurelyImplements docs, fix MutableList fq-name in example.

This commit is contained in:
Ilya Gorbunov
2016-12-06 18:44:14 +03:00
parent f66b4201d1
commit c3921d1e40
2 changed files with 14 additions and 4 deletions
@@ -22,17 +22,27 @@ package kotlin.jvm
*
* Example:
*
* ```java
* class MyList<T> extends AbstractList<T> { ... }
* ```
*
* Methods defined in MyList<T> use T as platform, i.e. it's possible to perform unsafe operation in Kotlin:
* Methods defined in `MyList<T>` use `T` as platform, i.e. it's possible to perform unsafe operation in Kotlin:
*
* ```kotlin
* MyList<Int>().add(null) // compiles
* ```
*
* @PurelyImplements("kotlin.MutableList")
* ```java
* @PurelyImplements("kotlin.collections.MutableList")
* class MyPureList<T> extends AbstractList<T> { ... }
* ```
*
* Methods defined in MyPureList<T> overriding methods in MutableList use T as non-platform types:
* Methods defined in `MyPureList<T>` overriding methods in `MutableList` use `T` as non-platform types:
*
* ```kotlin
* MyList<Int>().add(null) // Error
* MyList<Int?>().add(null) // Ok
* ```
*/
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
+1 -1
View File
@@ -26,7 +26,7 @@
<sequential>
<echo message="Building stdlib docs for JRE @{jdk.version}" />
<dokka src="stdlib/src:@{additional.src}:../core/builtins:../core/reflection.jvm:../core/runtime.jvm/src/kotlin/jvm/annotations:../core/runtime.jvm/src/kotlin/jvm/JvmClassMapping.kt"
<dokka src="stdlib/src:@{additional.src}:../core/builtins:../core/reflection.jvm:../core/runtime.jvm/src/kotlin/jvm/annotations:../core/runtime.jvm/src/kotlin/jvm/JvmClassMapping.kt:../core/runtime.jvm/src/kotlin/jvm/PurelyImplements.kt"
samples="stdlib/samples/src" outputDir="${output}/jre@{jdk.version}" moduleName="kotlin-stdlib" skipDeprecated="true" outputFormat="kotlin-website" jdkversion="@{jdk.version}"
include="stdlib/src/Module.md">
<sourcelink path=".." url="http://github.com/JetBrains/kotlin/blob/${github.revision}" linesuffix="#L"/>