InlineExposed usages are changed to PublishedApi

This commit is contained in:
Mikhael Bogdanov
2016-11-30 14:26:41 +01:00
parent 0f813d5cfe
commit 95a47e56f7
22 changed files with 45 additions and 91 deletions
@@ -128,7 +128,7 @@ val ClassNode.effectiveAccess: Int get() = innerClassNode?.access ?: access
val ClassNode.outerClassName: String? get() = innerClassNode?.outerName
const val inlineExposedAnnotationName = "kotlin/internal/InlineExposed"
const val inlineExposedAnnotationName = "kotlin/PublishedApi"
fun ClassNode.isInlineExposed() = findAnnotation(inlineExposedAnnotationName, includeInvisible = true) != null
fun MethodNode.isInlineExposed() = findAnnotation(inlineExposedAnnotationName, includeInvisible = true) != null
fun FieldNode.isInlineExposed() = findAnnotation(inlineExposedAnnotationName, includeInvisible = true) != null
@@ -1,24 +1,23 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package cases.inline
@kotlin.internal.InlineExposed
@PublishedApi
internal fun exposedForInline() {}
@kotlin.internal.InlineExposed
@PublishedApi
internal class InternalClassExposed
@kotlin.internal.InlineExposed
@PublishedApi
internal constructor() {
@kotlin.internal.InlineExposed
@PublishedApi
internal fun funExposed() {}
// TODO: Cover unsupported cases: requires correctly reflecting annotations from properties
/*
@kotlin.internal.InlineExposed
@PublishedApi
internal var propertyExposed: String? = null
@JvmField
@kotlin.internal.InlineExposed
@PublishedApi
internal var fieldExposed: String? = null
*/
@@ -545,7 +545,6 @@ fun generators(): List<GenericFunction> {
"""
val first = iterator()
val second = other.iterator()
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(collectionSizeOrDefault(10), other.collectionSizeOrDefault(10)))
while (first.hasNext() && second.hasNext()) {
list.add(transform(first.next(), second.next()))
@@ -556,7 +555,6 @@ fun generators(): List<GenericFunction> {
body(ArraysOfObjects, ArraysOfPrimitives) {
"""
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -582,7 +580,6 @@ fun generators(): List<GenericFunction> {
body {
"""
val arraySize = other.size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in this) {
@@ -181,7 +181,6 @@ fun snapshots(): List<GenericFunction> {
}
body {
"""
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
"""
@@ -193,14 +192,12 @@ fun snapshots(): List<GenericFunction> {
}
body(CharSequences) {
"""
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(length).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
"""
}
body(ArraysOfObjects, ArraysOfPrimitives) {
"""
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
"""
@@ -255,7 +252,6 @@ fun snapshots(): List<GenericFunction> {
body {
"""
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, T>(capacity), keySelector)
"""
@@ -267,14 +263,12 @@ fun snapshots(): List<GenericFunction> {
}
body(CharSequences) {
"""
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(length).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, T>(capacity), keySelector)
"""
}
body(ArraysOfObjects, ArraysOfPrimitives) {
"""
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, T>(capacity), keySelector)
"""
@@ -329,7 +323,6 @@ fun snapshots(): List<GenericFunction> {
body {
"""
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
"""
@@ -341,14 +334,12 @@ fun snapshots(): List<GenericFunction> {
}
body(CharSequences) {
"""
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(length).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
"""
}
body(ArraysOfObjects, ArraysOfPrimitives) {
"""
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
"""