diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Collections.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Collections.kt index bf521d36a9b..84a024c2763 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Collections.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Collections.kt @@ -8,6 +8,7 @@ fun collections(): List { val templates = ArrayList() templates add f("requireNoNulls()") { + isInline = false absentFor(PrimitiveArrays) // Those are inherently non-nulls doc = "Returns a original Iterable containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements" typeParam("T:Any") diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Commons.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Commons.kt index 1c1f7dbbc17..ed5ccfe92ba 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Commons.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Commons.kt @@ -84,6 +84,7 @@ fun commons(): ArrayList { } templates add f("filterNotNullTo(result: C)") { + isInline = false absentFor(PrimitiveArrays) // Those are inherently non-nulls doc = "Filters all non-*null* elements into the given list" typeParam("T:Any") @@ -273,6 +274,7 @@ fun commons(): ArrayList { } templates add f("drop(n: Int)") { + isInline = false doc = "Returns a list containing everything but the first *n* elements" returns("List") body { @@ -324,6 +326,7 @@ fun commons(): ArrayList { } templates add f("toCollection(result: C)") { + isInline = false doc = "Copies all elements into the given collection" typeParam("C: MutableCollection") returns("C") @@ -337,6 +340,7 @@ fun commons(): ArrayList { } templates add f("reverse()") { + isInline = false doc = "Reverses the order the elements into a list" returns("List") body { @@ -349,6 +353,7 @@ fun commons(): ArrayList { } templates add f("toLinkedList()") { + isInline = false doc = "Copies all elements into a [[LinkedList]]" returns("LinkedList") @@ -356,6 +361,7 @@ fun commons(): ArrayList { } templates add f("toList()") { + isInline = false doc = "Copies all elements into a [[List]]" returns("List") @@ -363,6 +369,7 @@ fun commons(): ArrayList { } templates add f("toSet()") { + isInline = false doc = "Copies all elements into a [[Set]]" returns("Set") @@ -370,6 +377,7 @@ fun commons(): ArrayList { } templates add f("toSortedSet()") { + isInline = false doc = "Copies all elements into a [[SortedSet]]" returns("SortedSet") @@ -377,6 +385,7 @@ fun commons(): ArrayList { } templates add f("withIndices()") { + isInline = false doc = "Returns an iterator of Pairs(index, data)" returns("Iterator>") @@ -446,6 +455,7 @@ fun commons(): ArrayList { } templates add f("appendString(buffer: Appendable, separator: String = \", \", prefix: String =\"\", postfix: String = \"\", limit: Int = -1, truncated: String = \"...\")") { + isInline = false doc = """ Appends the string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied @@ -473,6 +483,7 @@ fun commons(): ArrayList { } templates add f("makeString(separator: String = \", \", prefix: String = \"\", postfix: String = \"\", limit: Int = -1, truncated: String = \"...\")") { + isInline = false doc = """ Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied. diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Iterables.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Iterables.kt index f41e3aff852..589e80691bc 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Iterables.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Iterables.kt @@ -31,6 +31,7 @@ fun iterables(): ArrayList { } templates add f("filterNotNull()") { + isInline = false absentFor(PrimitiveArrays) // Those are inherently non-nulls doc = "Returns a list containing all the non-*null* elements" typeParam("T:Any") @@ -63,6 +64,7 @@ fun iterables(): ArrayList { } templates add f("take(n: Int)") { + isInline = false doc = "Returns a list containing the first *n* elements" returns("List") body { @@ -80,6 +82,7 @@ fun iterables(): ArrayList { } templates add f("requireNoNulls()") { + isInline = false absentFor(PrimitiveArrays) // Those are inherently non-nulls doc = "Returns a original Iterable containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements" typeParam("T:Any") @@ -101,6 +104,7 @@ fun iterables(): ArrayList { } templates add f("plus(element: T)") { + isInline = false doc = "Creates an [[Iterator]] which iterates over this iterator then the given element at the end" returns("List") @@ -116,6 +120,7 @@ fun iterables(): ArrayList { } templates add f("plus(iterator: Iterator)") { + isInline = false doc = "Creates an [[Iterator]] which iterates over this iterator then the following iterator" returns("List") @@ -132,6 +137,7 @@ fun iterables(): ArrayList { } templates add f("plus(collection: Iterable)") { + isInline = false doc = "Creates an [[Iterator]] which iterates over this iterator then the following collection" returns("List") diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Iterators.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Iterators.kt index c21ae1772cd..34c3e6c39cd 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Iterators.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Iterators.kt @@ -7,8 +7,9 @@ fun iterators(): List { val templates = commons() templates add f("filter(predicate: (T) -> Boolean)") { + isInline = false doc = "Returns an iterator over elements which match the given *predicate*" - + returns("Iterator") body { "return FilterIterator(this, predicate)" @@ -25,6 +26,7 @@ fun iterators(): List { } templates add f("filterNotNull()") { + isInline = false doc = "Returns an iterator over non-*null* elements" typeParam("T:Any") toNullableT = true @@ -36,6 +38,7 @@ fun iterators(): List { } templates add f("map(transform : (T) -> R)") { + isInline = false doc = "Returns an iterator obtained by applying *transform*, a function transforming an object of type *T* into an object of type *R*" typeParam("R") returns("Iterator") @@ -46,6 +49,7 @@ fun iterators(): List { } templates add f("flatMap(transform: (T) -> Iterator)") { + isInline = false doc = "Returns an iterator over the concatenated results of transforming each element to one or more values" typeParam("R") returns("Iterator") @@ -56,6 +60,7 @@ fun iterators(): List { } templates add f("requireNoNulls()") { + isInline = false doc = "Returns a original Iterable containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements" typeParam("T:Any") toNullableT = true @@ -73,6 +78,7 @@ fun iterators(): List { templates add f("take(n: Int)") { + isInline = false doc = "Returns an iterator restricted to the first *n* elements" returns("Iterator") body { @@ -84,6 +90,7 @@ fun iterators(): List { } templates add f("takeWhile(predicate: (T) -> Boolean)") { + isInline = false doc = "Returns an iterator restricted to the first elements that match the given *predicate*" returns("Iterator") @@ -95,6 +102,7 @@ fun iterators(): List { // TODO: drop(n), dropWhile templates add f("plus(element: T)") { + isInline = false doc = "Creates an [[Iterator]] which iterates over this iterator then the given element at the end" returns("Iterator") @@ -105,6 +113,7 @@ fun iterators(): List { } templates add f("plus(iterator: Iterator)") { + isInline = false doc = "Creates an [[Iterator]] which iterates over this iterator then the following iterator" returns("Iterator") @@ -114,6 +123,7 @@ fun iterators(): List { } templates add f("plus(collection: Iterable)") { + isInline = false doc = "Creates an [[Iterator]] which iterates over this iterator then the following collection" returns("Iterator")