Add associateWith to Array<T> #KT-30372
This commit is contained in:
@@ -437,10 +437,15 @@ object Snapshots : TemplateGroupBase() {
|
||||
}
|
||||
|
||||
val f_associateWith = fn("associateWith(valueSelector: (K) -> V)") {
|
||||
include(Iterables, Sequences, CharSequences)
|
||||
include(Iterables, Sequences, CharSequences, ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned)
|
||||
} builder {
|
||||
inline()
|
||||
specialFor(ArraysOfPrimitives, ArraysOfUnsigned) { inlineOnly() }
|
||||
since("1.3")
|
||||
specialFor(ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned) {
|
||||
since("1.4")
|
||||
annotation("@ExperimentalStdlibApi")
|
||||
}
|
||||
typeParam("K", primary = true)
|
||||
typeParam("V")
|
||||
returns("Map<K, V>")
|
||||
@@ -472,10 +477,15 @@ object Snapshots : TemplateGroupBase() {
|
||||
}
|
||||
|
||||
val f_associateWithTo = fn("associateWithTo(destination: M, valueSelector: (K) -> V)") {
|
||||
include(Iterables, Sequences, CharSequences)
|
||||
include(Iterables, Sequences, CharSequences, ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned)
|
||||
} builder {
|
||||
inline()
|
||||
specialFor(ArraysOfPrimitives, ArraysOfUnsigned) { inlineOnly() }
|
||||
since("1.3")
|
||||
specialFor(ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned) {
|
||||
since("1.4")
|
||||
annotation("@ExperimentalStdlibApi")
|
||||
}
|
||||
typeParam("K", primary = true)
|
||||
typeParam("V")
|
||||
typeParam("M : MutableMap<in K, in V>")
|
||||
|
||||
Reference in New Issue
Block a user