Use JvmName on kotlin.Metadata parameters to improve public API
#KT-26359 Fixed
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||
|
||||
package kotlin.reflect.jvm
|
||||
|
||||
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
|
||||
@@ -35,10 +33,12 @@ import kotlin.reflect.jvm.internal.deserializeToDescriptor
|
||||
*/
|
||||
fun <R> Function<R>.reflect(): KFunction<R>? {
|
||||
val annotation = javaClass.getAnnotation(Metadata::class.java) ?: return null
|
||||
val data = annotation.d1.takeUnless(Array<String>::isEmpty) ?: return null
|
||||
val (nameResolver, proto) = JvmProtoBufUtil.readFunctionDataFrom(data, annotation.d2)
|
||||
val metadataVersion =
|
||||
JvmMetadataVersion(annotation.mv, (annotation.xi and JvmAnnotationNames.METADATA_STRICT_VERSION_SEMANTICS_FLAG) != 0)
|
||||
val data = annotation.data1.takeUnless(Array<String>::isEmpty) ?: return null
|
||||
val (nameResolver, proto) = JvmProtoBufUtil.readFunctionDataFrom(data, annotation.data2)
|
||||
val metadataVersion = JvmMetadataVersion(
|
||||
annotation.metadataVersion,
|
||||
(annotation.extraInt and JvmAnnotationNames.METADATA_STRICT_VERSION_SEMANTICS_FLAG) != 0
|
||||
)
|
||||
|
||||
val descriptor = deserializeToDescriptor(
|
||||
javaClass, proto, nameResolver, TypeTable(proto.typeTable), metadataVersion, MemberDeserializer::loadFunction
|
||||
|
||||
Reference in New Issue
Block a user