diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index a335d97c322..2a055cbaa8c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -772,7 +772,7 @@ public interface Errors { DiagnosticFactory0 NESTED_CLASS_NOT_ALLOWED = DiagnosticFactory0.create(ERROR, DECLARATION_NAME); //Inline and inlinable parameters - DiagnosticFactory2 INVISIBLE_MEMBER_FROM_INLINE = DiagnosticFactory2.create(ERROR, CALL_ELEMENT); + DiagnosticFactory2 NON_PUBLIC_CALL_FROM_PUBLIC_INLINE = DiagnosticFactory2.create(ERROR, CALL_ELEMENT); DiagnosticFactory2 PRIVATE_CLASS_MEMBER_FROM_INLINE = DiagnosticFactory2.create(ERROR, CALL_ELEMENT); DiagnosticFactory1 NON_LOCAL_RETURN_NOT_ALLOWED = DiagnosticFactory1.create(ERROR, CALL_ELEMENT); DiagnosticFactory2 NOT_YET_SUPPORTED_IN_INLINE = DiagnosticFactory2.create(ERROR); @@ -789,7 +789,7 @@ public interface Errors { ImmutableSet> UNRESOLVED_REFERENCE_DIAGNOSTICS = ImmutableSet.of( UNRESOLVED_REFERENCE, NAMED_PARAMETER_NOT_FOUND, UNRESOLVED_REFERENCE_WRONG_RECEIVER); ImmutableSet> INVISIBLE_REFERENCE_DIAGNOSTICS = ImmutableSet.of( - INVISIBLE_MEMBER, INVISIBLE_MEMBER_FROM_INLINE, INVISIBLE_REFERENCE, INVISIBLE_SETTER); + INVISIBLE_MEMBER, NON_PUBLIC_CALL_FROM_PUBLIC_INLINE, INVISIBLE_REFERENCE, INVISIBLE_SETTER); ImmutableSet> UNUSED_ELEMENT_DIAGNOSTICS = ImmutableSet.of( UNUSED_VARIABLE, UNUSED_PARAMETER, ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE, VARIABLE_WITH_REDUNDANT_INITIALIZER, UNUSED_LAMBDA_EXPRESSION, USELESS_CAST, UNUSED_VALUE, USELESS_ELVIS); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 436673afa7b..e0af1354d0c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -732,9 +732,8 @@ public class DefaultErrorMessages { MAP.put(ARRAY_CLASS_LITERAL_REQUIRES_ARGUMENT, "kotlin.Array class literal requires a type argument, please specify one in angle brackets"); //Inline - MAP.put(INVISIBLE_MEMBER_FROM_INLINE, "Public-API inline function cannot access non-public-API ''{0}''", SHORT_NAMES_IN_TYPES, SHORT_NAMES_IN_TYPES); + MAP.put(NON_PUBLIC_CALL_FROM_PUBLIC_INLINE, "Public-API inline function cannot access non-public-API ''{0}''", SHORT_NAMES_IN_TYPES, SHORT_NAMES_IN_TYPES); MAP.put(PRIVATE_CLASS_MEMBER_FROM_INLINE, "Non-private inline function cannot access members of private classes: ''{0}''", SHORT_NAMES_IN_TYPES, SHORT_NAMES_IN_TYPES); - MAP.put(NOT_YET_SUPPORTED_IN_INLINE, "''{0}'' construction is not yet supported in inline functions", ELEMENT_TEXT, SHORT_NAMES_IN_TYPES); MAP.put(DECLARATION_CANT_BE_INLINED, "''inline'' modifier is not allowed on virtual members. Only private or final members can be inlined"); MAP.put(NOTHING_TO_INLINE, "Expected performance impact of inlining ''{0}'' can be insignificant. Inlining works best for functions with lambda parameters", SHORT_NAMES_IN_TYPES); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/InlineChecker.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/InlineChecker.java index e17ae7430de..2815c3000cf 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/InlineChecker.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/InlineChecker.java @@ -241,7 +241,7 @@ class InlineChecker implements CallChecker { private void checkVisibilityAndAccess(@NotNull CallableDescriptor declarationDescriptor, @NotNull KtElement expression, @NotNull BasicCallResolutionContext context){ boolean declarationDescriptorIsPublicApi = DescriptorUtilsKt.isEffectivelyPublicApi(declarationDescriptor) || isDefinedInInlineFunction(declarationDescriptor); if (isEffectivelyPublicApiFunction && !declarationDescriptorIsPublicApi && declarationDescriptor.getVisibility() != Visibilities.LOCAL) { - context.trace.report(Errors.INVISIBLE_MEMBER_FROM_INLINE.on(expression, declarationDescriptor, descriptor)); + context.trace.report(Errors.NON_PUBLIC_CALL_FROM_PUBLIC_INLINE.on(expression, declarationDescriptor, descriptor)); } else { checkPrivateClassMemberAccess(declarationDescriptor, expression, context); diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicClass.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicClass.kt index d9b0c992fb2..65fbc191e36 100644 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicClass.kt +++ b/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicClass.kt @@ -5,8 +5,8 @@ private class Z public constructor(){ } public inline fun test() { - Z().publicProperty - Z().publicFun() + Z().publicProperty + Z().publicFun() } internal inline fun testInternal() { diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inPackage.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/inPackage.kt index 90ec12b0adc..8d327a43e81 100644 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inPackage.kt +++ b/compiler/testData/diagnostics/tests/inline/nonPublicMember/inPackage.kt @@ -7,13 +7,13 @@ internal val internalProperty = 11; internal fun internalFun() {} public inline fun test() { - privateFun() - privateProperty + privateFun() + privateProperty } public inline fun test2() { - internalFun() - internalProperty + internalFun() + internalProperty } internal inline fun testInternal() { diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inPublicClass.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/inPublicClass.kt index 8b501ea9840..dc6add88bc0 100644 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inPublicClass.kt +++ b/compiler/testData/diagnostics/tests/inline/nonPublicMember/inPublicClass.kt @@ -8,8 +8,8 @@ public class Z { } public inline fun test() { - Z().privateProperty - Z().privateFun() + Z().privateProperty + Z().privateFun() } internal inline fun testInternal() { @@ -26,8 +26,8 @@ public class Z2 { } public inline fun test() { - privateProperty - privateFun() + privateProperty + privateFun() } internal inline fun testInternal() { diff --git a/libraries/stdlib/src/generated/_Arrays.kt b/libraries/stdlib/src/generated/_Arrays.kt index cdef5951d89..6a11663e0d0 100644 --- a/libraries/stdlib/src/generated/_Arrays.kt +++ b/libraries/stdlib/src/generated/_Arrays.kt @@ -5491,7 +5491,7 @@ public fun Array.toShortArray(): ShortArray { * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun Array.associate(transform: (T) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -5502,7 +5502,7 @@ public inline fun Array.associate(transform: (T) -> Pair) * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun ByteArray.associate(transform: (Byte) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -5513,7 +5513,7 @@ public inline fun ByteArray.associate(transform: (Byte) -> Pair): M * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun ShortArray.associate(transform: (Short) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -5524,7 +5524,7 @@ public inline fun ShortArray.associate(transform: (Short) -> Pair): * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun IntArray.associate(transform: (Int) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -5535,7 +5535,7 @@ public inline fun IntArray.associate(transform: (Int) -> Pair): Map * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun LongArray.associate(transform: (Long) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -5546,7 +5546,7 @@ public inline fun LongArray.associate(transform: (Long) -> Pair): M * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun FloatArray.associate(transform: (Float) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -5557,7 +5557,7 @@ public inline fun FloatArray.associate(transform: (Float) -> Pair): * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun DoubleArray.associate(transform: (Double) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -5568,7 +5568,7 @@ public inline fun DoubleArray.associate(transform: (Double) -> Pair * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun BooleanArray.associate(transform: (Boolean) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -5579,7 +5579,7 @@ public inline fun BooleanArray.associate(transform: (Boolean) -> Pair CharArray.associate(transform: (Char) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -5590,7 +5590,7 @@ public inline fun CharArray.associate(transform: (Char) -> Pair): M * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun Array.associateBy(keySelector: (T) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -5601,7 +5601,7 @@ public inline fun Array.associateBy(keySelector: (T) -> K): Map ByteArray.associateBy(keySelector: (Byte) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -5612,7 +5612,7 @@ public inline fun ByteArray.associateBy(keySelector: (Byte) -> K): Map ShortArray.associateBy(keySelector: (Short) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -5623,7 +5623,7 @@ public inline fun ShortArray.associateBy(keySelector: (Short) -> K): Map IntArray.associateBy(keySelector: (Int) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -5634,7 +5634,7 @@ public inline fun IntArray.associateBy(keySelector: (Int) -> K): Map * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun LongArray.associateBy(keySelector: (Long) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -5645,7 +5645,7 @@ public inline fun LongArray.associateBy(keySelector: (Long) -> K): Map FloatArray.associateBy(keySelector: (Float) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -5656,7 +5656,7 @@ public inline fun FloatArray.associateBy(keySelector: (Float) -> K): Map DoubleArray.associateBy(keySelector: (Double) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -5667,7 +5667,7 @@ public inline fun DoubleArray.associateBy(keySelector: (Double) -> K): Map BooleanArray.associateBy(keySelector: (Boolean) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -5678,7 +5678,7 @@ public inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K): Map * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun CharArray.associateBy(keySelector: (Char) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -5688,7 +5688,7 @@ public inline fun CharArray.associateBy(keySelector: (Char) -> K): Map Array.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -5698,7 +5698,7 @@ public inline fun Array.associateBy(keySelector: (T) -> K, valu * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun ByteArray.associateBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -5708,7 +5708,7 @@ public inline fun ByteArray.associateBy(keySelector: (Byte) -> K, valueTr * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun ShortArray.associateBy(keySelector: (Short) -> K, valueTransform: (Short) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -5718,7 +5718,7 @@ public inline fun ShortArray.associateBy(keySelector: (Short) -> K, value * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun IntArray.associateBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -5728,7 +5728,7 @@ public inline fun IntArray.associateBy(keySelector: (Int) -> K, valueTran * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun LongArray.associateBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -5738,7 +5738,7 @@ public inline fun LongArray.associateBy(keySelector: (Long) -> K, valueTr * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun FloatArray.associateBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -5748,7 +5748,7 @@ public inline fun FloatArray.associateBy(keySelector: (Float) -> K, value * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun DoubleArray.associateBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -5758,7 +5758,7 @@ public inline fun DoubleArray.associateBy(keySelector: (Double) -> K, val * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -5768,7 +5768,7 @@ public inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K, v * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun CharArray.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -11383,7 +11383,7 @@ public infix fun CharArray.zip(other: Iterable): List> { */ public inline fun Array.zip(other: Iterable, transform: (T, R) -> V): List { val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { @@ -11398,7 +11398,7 @@ public inline fun Array.zip(other: Iterable, transform: (T, */ public inline fun ByteArray.zip(other: Iterable, transform: (Byte, R) -> V): List { val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { @@ -11413,7 +11413,7 @@ public inline fun ByteArray.zip(other: Iterable, transform: (Byte, R) */ public inline fun ShortArray.zip(other: Iterable, transform: (Short, R) -> V): List { val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { @@ -11428,7 +11428,7 @@ public inline fun ShortArray.zip(other: Iterable, transform: (Short, R */ public inline fun IntArray.zip(other: Iterable, transform: (Int, R) -> V): List { val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { @@ -11443,7 +11443,7 @@ public inline fun IntArray.zip(other: Iterable, transform: (Int, R) -> */ public inline fun LongArray.zip(other: Iterable, transform: (Long, R) -> V): List { val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { @@ -11458,7 +11458,7 @@ public inline fun LongArray.zip(other: Iterable, transform: (Long, R) */ public inline fun FloatArray.zip(other: Iterable, transform: (Float, R) -> V): List { val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { @@ -11473,7 +11473,7 @@ public inline fun FloatArray.zip(other: Iterable, transform: (Float, R */ public inline fun DoubleArray.zip(other: Iterable, transform: (Double, R) -> V): List { val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { @@ -11488,7 +11488,7 @@ public inline fun DoubleArray.zip(other: Iterable, transform: (Double, */ public inline fun BooleanArray.zip(other: Iterable, transform: (Boolean, R) -> V): List { val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { @@ -11503,7 +11503,7 @@ public inline fun BooleanArray.zip(other: Iterable, transform: (Boolea */ public inline fun CharArray.zip(other: Iterable, transform: (Char, R) -> V): List { val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { diff --git a/libraries/stdlib/src/generated/_Collections.kt b/libraries/stdlib/src/generated/_Collections.kt index 478017d7d6b..12657e7f0b9 100644 --- a/libraries/stdlib/src/generated/_Collections.kt +++ b/libraries/stdlib/src/generated/_Collections.kt @@ -926,7 +926,7 @@ public fun Collection.toShortArray(): ShortArray { * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun Iterable.associate(transform: (T) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -937,7 +937,7 @@ public inline fun Iterable.associate(transform: (T) -> Pair): * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun Iterable.associateBy(keySelector: (T) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -947,7 +947,7 @@ public inline fun Iterable.associateBy(keySelector: (T) -> K): Map Iterable.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } @@ -1168,7 +1168,7 @@ public inline fun >> Iterable.gr * Returns a list containing the results of applying the given [transform] function * to each element in the original collection. */ -@Suppress("INVISIBLE_MEMBER_FROM_INLINE") +@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Iterable.map(transform: (T) -> R): List { return mapTo(ArrayList(collectionSizeOrDefault(10)), transform) } @@ -1177,7 +1177,7 @@ public inline fun Iterable.map(transform: (T) -> R): List { * Returns a list containing the results of applying the given [transform] function * to each element and its index in the original collection. */ -@Suppress("INVISIBLE_MEMBER_FROM_INLINE") +@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Iterable.mapIndexed(transform: (Int, T) -> R): List { return mapIndexedTo(ArrayList(collectionSizeOrDefault(10)), transform) } @@ -1810,7 +1810,7 @@ public infix fun Iterable.zip(other: Array): List> { */ public inline fun Iterable.zip(other: Array, transform: (T, R) -> V): List { val arraySize = other.size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in this) { @@ -1833,7 +1833,7 @@ public infix fun Iterable.zip(other: Iterable): List> { public inline fun Iterable.zip(other: Iterable, transform: (T, R) -> V): List { val first = iterator() val second = other.iterator() - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(collectionSizeOrDefault(10), other.collectionSizeOrDefault(10))) while (first.hasNext() && second.hasNext()) { list.add(transform(first.next(), second.next())) diff --git a/libraries/stdlib/src/generated/_Strings.kt b/libraries/stdlib/src/generated/_Strings.kt index f8879ae70af..a8a7bbdc91f 100644 --- a/libraries/stdlib/src/generated/_Strings.kt +++ b/libraries/stdlib/src/generated/_Strings.kt @@ -499,7 +499,7 @@ public inline fun String.reversed(): String { * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun CharSequence.associate(transform: (Char) -> Pair): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(length).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) } @@ -510,7 +510,7 @@ public inline fun CharSequence.associate(transform: (Char) -> Pair) * If any two characters would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun CharSequence.associateBy(keySelector: (Char) -> K): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(length).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) } @@ -520,7 +520,7 @@ public inline fun CharSequence.associateBy(keySelector: (Char) -> K): Map CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(length).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) } diff --git a/libraries/stdlib/src/kotlin/collections/MapAccessors.kt b/libraries/stdlib/src/kotlin/collections/MapAccessors.kt index 6f759f3e753..a533dcb80a0 100644 --- a/libraries/stdlib/src/kotlin/collections/MapAccessors.kt +++ b/libraries/stdlib/src/kotlin/collections/MapAccessors.kt @@ -13,7 +13,7 @@ import kotlin.internal.Exact * @throws NoSuchElementException when the map doesn't contain value for the property name and doesn't provide an implicit default (see [withDefault]). */ @kotlin.internal.InlineOnly -@Suppress("INVISIBLE_MEMBER_FROM_INLINE") +@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline operator fun Map.getValue(thisRef: Any?, property: KProperty<*>): V1 = getOrImplicitDefault(property.name) as V1 @@ -27,7 +27,7 @@ public inline operator fun Map.getValue(thisRef: */ @kotlin.jvm.JvmName("getVar") @kotlin.internal.InlineOnly -@Suppress("INVISIBLE_MEMBER_FROM_INLINE") +@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline operator fun MutableMap.getValue(thisRef: Any?, property: KProperty<*>): V = getOrImplicitDefault(property.name) as V diff --git a/libraries/stdlib/src/kotlin/collections/Maps.kt b/libraries/stdlib/src/kotlin/collections/Maps.kt index 9d733df7327..f2c6a338b52 100644 --- a/libraries/stdlib/src/kotlin/collections/Maps.kt +++ b/libraries/stdlib/src/kotlin/collections/Maps.kt @@ -278,7 +278,7 @@ public fun MutableMap.putAll(pairs: Sequence>): Uni * * @sample test.collections.MapTest.mapValues */ -@Suppress("INVISIBLE_MEMBER_FROM_INLINE") +@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Map.mapValues(transform: (Map.Entry) -> R): Map { return mapValuesTo(LinkedHashMap(mapCapacity(size)), transform) } @@ -289,7 +289,7 @@ public inline fun Map.mapValues(transform: (Map.Entry) -> * * @sample test.collections.MapTest.mapKeys */ -@Suppress("INVISIBLE_MEMBER_FROM_INLINE") +@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") public inline fun Map.mapKeys(transform: (Map.Entry) -> R): Map { return mapKeysTo(LinkedHashMap(mapCapacity(size)), transform) } diff --git a/libraries/stdlib/src/kotlin/concurrent/Timer.kt b/libraries/stdlib/src/kotlin/concurrent/Timer.kt index 77dfce26351..6dc737cc274 100644 --- a/libraries/stdlib/src/kotlin/concurrent/Timer.kt +++ b/libraries/stdlib/src/kotlin/concurrent/Timer.kt @@ -87,7 +87,7 @@ internal fun timer(name: String?, daemon: Boolean) = if (name == null) Timer(dae */ @kotlin.internal.InlineOnly public inline fun timer(name: String? = null, daemon: Boolean = false, initialDelay: Long = 0.toLong(), period: Long, crossinline action: TimerTask.() -> Unit): Timer { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val timer = timer(name, daemon) timer.schedule(initialDelay, period, action) return timer @@ -102,7 +102,7 @@ public inline fun timer(name: String? = null, daemon: Boolean = false, initialDe */ @kotlin.internal.InlineOnly public inline fun timer(name: String? = null, daemon: Boolean = false, startAt: Date, period: Long, crossinline action: TimerTask.() -> Unit): Timer { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val timer = timer(name, daemon) timer.schedule(startAt, period, action) return timer @@ -118,7 +118,7 @@ public inline fun timer(name: String? = null, daemon: Boolean = false, startAt: */ @kotlin.internal.InlineOnly public inline fun fixedRateTimer(name: String? = null, daemon: Boolean = false, initialDelay: Long = 0.toLong(), period: Long, crossinline action: TimerTask.() -> Unit): Timer { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val timer = timer(name, daemon) timer.scheduleAtFixedRate(initialDelay, period, action) return timer @@ -133,7 +133,7 @@ public inline fun fixedRateTimer(name: String? = null, daemon: Boolean = false, */ @kotlin.internal.InlineOnly public inline fun fixedRateTimer(name: String? = null, daemon: Boolean = false, startAt: Date, period: Long, crossinline action: TimerTask.() -> Unit): Timer { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val timer = timer(name, daemon) timer.scheduleAtFixedRate(startAt, period, action) return timer diff --git a/libraries/stdlib/src/kotlin/text/regex/RegexExtensions.kt b/libraries/stdlib/src/kotlin/text/regex/RegexExtensions.kt index ac62bd6bdde..36197a24d66 100644 --- a/libraries/stdlib/src/kotlin/text/regex/RegexExtensions.kt +++ b/libraries/stdlib/src/kotlin/text/regex/RegexExtensions.kt @@ -28,5 +28,5 @@ public inline fun String.toRegex(options: Set): Regex = Regex(this, */ @JvmVersion @kotlin.internal.InlineOnly -@Suppress("INVISIBLE_MEMBER_FROM_INLINE") +@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/stdlib/src/kotlin/util/AssertionsJVM.kt b/libraries/stdlib/src/kotlin/util/AssertionsJVM.kt index 69258c63a6a..780dc4f9054 100644 --- a/libraries/stdlib/src/kotlin/util/AssertionsJVM.kt +++ b/libraries/stdlib/src/kotlin/util/AssertionsJVM.kt @@ -23,7 +23,7 @@ public inline fun assert(value: Boolean) { */ @kotlin.internal.InlineOnly public inline fun assert(value: Boolean, lazyMessage: () -> Any) { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") if (_Assertions.ENABLED) { if (!value) { val message = lazyMessage() diff --git a/libraries/stdlib/src/kotlin/util/Synchronized.kt b/libraries/stdlib/src/kotlin/util/Synchronized.kt index 47dec0979b1..5341f0f98a1 100644 --- a/libraries/stdlib/src/kotlin/util/Synchronized.kt +++ b/libraries/stdlib/src/kotlin/util/Synchronized.kt @@ -10,13 +10,13 @@ import kotlin.jvm.internal.unsafe.* */ @kotlin.internal.InlineOnly public inline fun synchronized(lock: Any, block: () -> R): R { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") monitorEnter(lock) try { return block() } finally { - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") monitorExit(lock) } } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt index 54a6c538383..161837130e8 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt @@ -485,7 +485,7 @@ fun generators(): List { """ val first = iterator() val second = other.iterator() - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(collectionSizeOrDefault(10), other.collectionSizeOrDefault(10))) while (first.hasNext() && second.hasNext()) { list.add(transform(first.next(), second.next())) @@ -496,7 +496,7 @@ fun generators(): List { body(ArraysOfObjects, ArraysOfPrimitives) { """ val arraySize = size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(other.collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in other) { @@ -522,7 +522,7 @@ fun generators(): List { body { """ val arraySize = other.size - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val list = ArrayList(Math.min(collectionSizeOrDefault(10), arraySize)) var i = 0 for (element in this) { diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt index ab29e1dd275..e009f7a1191 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt @@ -34,7 +34,7 @@ fun mapping(): List { } typeParam("R") returns("List") - annotations(Iterables) { """@Suppress("INVISIBLE_MEMBER_FROM_INLINE")""" } + annotations(Iterables) { """@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")""" } body(Iterables) { "return mapIndexedTo(ArrayList(collectionSizeOrDefault(10)), transform)" } @@ -62,7 +62,7 @@ fun mapping(): List { } typeParam("R") returns("List") - annotations(Iterables) { """@Suppress("INVISIBLE_MEMBER_FROM_INLINE")""" } + annotations(Iterables) { """@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")""" } body(Iterables) { "return mapTo(ArrayList(collectionSizeOrDefault(10)), transform)" } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt index 244691a9aa6..e724c8711c0 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt @@ -153,7 +153,7 @@ fun snapshots(): List { } body { """ - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) """ @@ -165,14 +165,14 @@ fun snapshots(): List { } body(CharSequences) { """ - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(length).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) """ } body(ArraysOfObjects, ArraysOfPrimitives) { """ - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateTo(LinkedHashMap(capacity), transform) """ @@ -231,7 +231,7 @@ fun snapshots(): List { body { """ - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) """ @@ -243,14 +243,14 @@ fun snapshots(): List { } body(CharSequences) { """ - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(length).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) """ } body(ArraysOfObjects, ArraysOfPrimitives) { """ - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector) """ @@ -325,7 +325,7 @@ fun snapshots(): List { body { """ - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) """ @@ -337,14 +337,14 @@ fun snapshots(): List { } body(CharSequences) { """ - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(length).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) """ } body(ArraysOfObjects, ArraysOfPrimitives) { """ - @Suppress("INVISIBLE_MEMBER_FROM_INLINE") + @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") val capacity = mapCapacity(size).coerceAtLeast(16) return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform) """