diff --git a/libraries/stdlib/src/generated/ArraysFromJLangIterablesLazy.kt b/libraries/stdlib/src/generated/ArraysFromJLangIterablesLazy.kt index f3bbcbc9cba..6bd375e692c 100644 --- a/libraries/stdlib/src/generated/ArraysFromJLangIterablesLazy.kt +++ b/libraries/stdlib/src/generated/ArraysFromJLangIterablesLazy.kt @@ -42,6 +42,29 @@ public inline fun Array?.filterNotNull() : List = filterNotNullTo Array.flatMap(transform: (T)-> Collection) : Collection = flatMapTo(ArrayList(), transform) +/** + * Creates a copy of this collection as a [[List]] with the element added at the end + * + * @includeFunctionBody ../../test/CollectionTest.kt plus + */ +public inline fun Array.plus(element: T): List { + val list = to(ArrayList()) + list.add(element) + return list +} + + +/** + * Creates a copy of this collection as a [[List]] with all the elements added at the end + * + * @includeFunctionBody ../../test/CollectionTest.kt plusCollection + */ +public inline fun Array.plus(elements: Array): List { + val list = to(ArrayList()) + list.addAll(elements.toCollection()) + return list +} + /** * Returns a list containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements * diff --git a/libraries/stdlib/src/generated/StandardFromJLangIterablesLazy.kt b/libraries/stdlib/src/generated/StandardFromJLangIterablesLazy.kt index 3fbfefb60fd..da63be3f6c9 100644 --- a/libraries/stdlib/src/generated/StandardFromJLangIterablesLazy.kt +++ b/libraries/stdlib/src/generated/StandardFromJLangIterablesLazy.kt @@ -42,6 +42,29 @@ public inline fun Iterable?.filterNotNull() : List = filterNotNullTo< */ public inline fun Iterable.flatMap(transform: (T)-> Collection) : Collection = flatMapTo(ArrayList(), transform) +/** + * Creates a copy of this collection as a [[List]] with the element added at the end + * + * @includeFunctionBody ../../test/CollectionTest.kt plus + */ +public inline fun Iterable.plus(element: T): List { + val list = to(ArrayList()) + list.add(element) + return list +} + + +/** + * Creates a copy of this collection as a [[List]] with all the elements added at the end + * + * @includeFunctionBody ../../test/CollectionTest.kt plusCollection + */ +public inline fun Iterable.plus(elements: Iterable): List { + val list = to(ArrayList()) + list.addAll(elements.toCollection()) + return list +} + /** * Returns a list containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements *