From f22375601b336d931277d74008706ce7d2796763 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 14 Apr 2017 17:37:29 +0300 Subject: [PATCH] Remove unneeded suppressions --- js/js.libraries/src/core/generated/_CollectionsJs.kt | 2 -- libraries/stdlib/common/src/generated/_Collections.kt | 2 -- libraries/stdlib/src/generated/_Collections.kt | 2 -- libraries/stdlib/src/kotlin/collections/MapAccessors.kt | 4 ++-- libraries/stdlib/src/kotlin/collections/Maps.kt | 2 -- libraries/stdlib/src/kotlin/text/regex/RegexExtensions.kt | 1 - libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt | 2 -- 7 files changed, 2 insertions(+), 13 deletions(-) diff --git a/js/js.libraries/src/core/generated/_CollectionsJs.kt b/js/js.libraries/src/core/generated/_CollectionsJs.kt index fd3617c9c0c..710ceb11c7e 100644 --- a/js/js.libraries/src/core/generated/_CollectionsJs.kt +++ b/js/js.libraries/src/core/generated/_CollectionsJs.kt @@ -1202,7 +1202,6 @@ public inline fun Iterable.groupingBy(crossinline keySelector: (T) -> * Returns a list containing the results of applying the given [transform] function * to each element in the original collection. */ -@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Iterable.map(transform: (T) -> R): List { return mapTo(ArrayList(collectionSizeOrDefault(10)), transform) } @@ -1213,7 +1212,6 @@ public inline fun Iterable.map(transform: (T) -> R): List { * @param [transform] function that takes the index of an element and the element itself * and returns the result of the transform applied to the element. */ -@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Iterable.mapIndexed(transform: (index: Int, T) -> R): List { return mapIndexedTo(ArrayList(collectionSizeOrDefault(10)), transform) } diff --git a/libraries/stdlib/common/src/generated/_Collections.kt b/libraries/stdlib/common/src/generated/_Collections.kt index 94683ad81b5..9db5bfa1e0a 100644 --- a/libraries/stdlib/common/src/generated/_Collections.kt +++ b/libraries/stdlib/common/src/generated/_Collections.kt @@ -602,7 +602,6 @@ public header inline fun Iterable.groupingBy(crossinline keySelector: * Returns a list containing the results of applying the given [transform] function * to each element in the original collection. */ -@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public header inline fun Iterable.map(transform: (T) -> R): List /** @@ -611,7 +610,6 @@ public header inline fun Iterable.map(transform: (T) -> R): List * @param [transform] function that takes the index of an element and the element itself * and returns the result of the transform applied to the element. */ -@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public header inline fun Iterable.mapIndexed(transform: (index: Int, T) -> R): List /** diff --git a/libraries/stdlib/src/generated/_Collections.kt b/libraries/stdlib/src/generated/_Collections.kt index 0706f33ef88..2209f358bee 100644 --- a/libraries/stdlib/src/generated/_Collections.kt +++ b/libraries/stdlib/src/generated/_Collections.kt @@ -1212,7 +1212,6 @@ public inline fun Iterable.groupingBy(crossinline keySelector: (T) -> * Returns a list containing the results of applying the given [transform] function * to each element in the original collection. */ -@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Iterable.map(transform: (T) -> R): List { return mapTo(ArrayList(collectionSizeOrDefault(10)), transform) } @@ -1223,7 +1222,6 @@ public inline fun Iterable.map(transform: (T) -> R): List { * @param [transform] function that takes the index of an element and the element itself * and returns the result of the transform applied to the element. */ -@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Iterable.mapIndexed(transform: (index: Int, T) -> R): List { return mapIndexedTo(ArrayList(collectionSizeOrDefault(10)), transform) } diff --git a/libraries/stdlib/src/kotlin/collections/MapAccessors.kt b/libraries/stdlib/src/kotlin/collections/MapAccessors.kt index 2e54db5aa1f..7c2b8d66f73 100644 --- a/libraries/stdlib/src/kotlin/collections/MapAccessors.kt +++ b/libraries/stdlib/src/kotlin/collections/MapAccessors.kt @@ -14,7 +14,7 @@ import kotlin.internal.Exact */ @kotlin.internal.InlineOnly public inline operator fun Map.getValue(thisRef: Any?, property: KProperty<*>): V1 - = @Suppress("UNCHECKED_CAST", "NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") (getOrImplicitDefault(property.name) as V1) + = @Suppress("UNCHECKED_CAST") (getOrImplicitDefault(property.name) as V1) /** * Returns the value of the property for the given object from this mutable map. @@ -27,7 +27,7 @@ public inline operator fun Map.getValue(thisRef: @kotlin.jvm.JvmName("getVar") @kotlin.internal.InlineOnly public inline operator fun MutableMap.getValue(thisRef: Any?, property: KProperty<*>): V - = @Suppress("UNCHECKED_CAST", "NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") (getOrImplicitDefault(property.name) as V) + = @Suppress("UNCHECKED_CAST") (getOrImplicitDefault(property.name) as V) /** * Stores the value of the property for the given object in this mutable map. diff --git a/libraries/stdlib/src/kotlin/collections/Maps.kt b/libraries/stdlib/src/kotlin/collections/Maps.kt index 4f87c8129ba..a77367c2c44 100644 --- a/libraries/stdlib/src/kotlin/collections/Maps.kt +++ b/libraries/stdlib/src/kotlin/collections/Maps.kt @@ -341,7 +341,6 @@ public fun MutableMap.putAll(pairs: Sequence>): Uni * * @sample samples.collections.Maps.Transforms.mapValues */ -@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Map.mapValues(transform: (Map.Entry) -> R): Map { return mapValuesTo(LinkedHashMap(mapCapacity(size)), transform) // .optimizeReadOnlyMap() } @@ -357,7 +356,6 @@ public inline fun Map.mapValues(transform: (Map.Entry) * * @sample samples.collections.Maps.Transforms.mapKeys */ -@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Map.mapKeys(transform: (Map.Entry) -> R): Map { return mapKeysTo(LinkedHashMap(mapCapacity(size)), transform) // .optimizeReadOnlyMap() } diff --git a/libraries/stdlib/src/kotlin/text/regex/RegexExtensions.kt b/libraries/stdlib/src/kotlin/text/regex/RegexExtensions.kt index 36197a24d66..15fda3fde4b 100644 --- a/libraries/stdlib/src/kotlin/text/regex/RegexExtensions.kt +++ b/libraries/stdlib/src/kotlin/text/regex/RegexExtensions.kt @@ -28,5 +28,4 @@ public inline fun String.toRegex(options: Set): Regex = Regex(this, */ @JvmVersion @kotlin.internal.InlineOnly -@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun java.util.regex.Pattern.toRegex(): Regex = Regex(this) \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt index 8c452db9c7b..e88e5d10fe8 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt @@ -37,7 +37,6 @@ fun mapping(): List { } typeParam("R") returns("List") - annotations(Iterables) { """@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")""" } body(Iterables) { "return mapIndexedTo(ArrayList(collectionSizeOrDefault(10)), transform)" } @@ -65,7 +64,6 @@ fun mapping(): List { } typeParam("R") returns("List") - annotations(Iterables) { """@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")""" } body(Iterables) { "return mapTo(ArrayList(collectionSizeOrDefault(10)), transform)" }