diff --git a/core/reflection.jvm/src/kotlin/reflect/KAnnotatedElements.kt b/core/reflection.jvm/src/kotlin/reflect/KAnnotatedElements.kt index 4fe78f34a94..7f8ee9fbfae 100644 --- a/core/reflection.jvm/src/kotlin/reflect/KAnnotatedElements.kt +++ b/core/reflection.jvm/src/kotlin/reflect/KAnnotatedElements.kt @@ -15,11 +15,13 @@ */ @file:JvmName("KAnnotatedElements") +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") package kotlin.reflect /** * Returns an annotation of the given type on this element. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'findAnnotation' from kotlin.reflect.full package", ReplaceWith("this.findAnnotation()", "kotlin.reflect.full.findAnnotation"), level = DeprecationLevel.WARNING) @Suppress("UNCHECKED_CAST") inline fun KAnnotatedElement.findAnnotation(): T? = diff --git a/core/reflection.jvm/src/kotlin/reflect/KCallables.kt b/core/reflection.jvm/src/kotlin/reflect/KCallables.kt index ba60e23fcea..a80855b4b80 100644 --- a/core/reflection.jvm/src/kotlin/reflect/KCallables.kt +++ b/core/reflection.jvm/src/kotlin/reflect/KCallables.kt @@ -15,6 +15,7 @@ */ @file:JvmName("KCallables") +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") package kotlin.reflect import kotlin.reflect.full.extensionReceiverParameter @@ -26,6 +27,7 @@ import kotlin.reflect.full.valueParameters * Returns a parameter representing the `this` instance needed to call this callable, * or `null` if this callable is not a member of a class and thus doesn't take such parameter. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'instanceParameter' from kotlin.reflect.full package", ReplaceWith("this.instanceParameter", "kotlin.reflect.full.instanceParameter"), level = DeprecationLevel.ERROR) @SinceKotlin("1.1") inline val KCallable<*>.instanceParameter: KParameter? @@ -35,6 +37,7 @@ inline val KCallable<*>.instanceParameter: KParameter? * Returns a parameter representing the extension receiver instance needed to call this callable, * or `null` if this callable is not an extension. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'extensionReceiverParameter' from kotlin.reflect.full package", ReplaceWith("this.extensionReceiverParameter", "kotlin.reflect.full.extensionReceiverParameter"), level = DeprecationLevel.ERROR) @SinceKotlin("1.1") inline val KCallable<*>.extensionReceiverParameter: KParameter? @@ -43,6 +46,7 @@ inline val KCallable<*>.extensionReceiverParameter: KParameter? /** * Returns parameters of this callable, excluding the `this` instance and the extension receiver parameter. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'valueParameters' from kotlin.reflect.full package", ReplaceWith("this.valueParameters", "kotlin.reflect.full.valueParameters"), level = DeprecationLevel.ERROR) @SinceKotlin("1.1") inline val KCallable<*>.valueParameters: List @@ -51,6 +55,7 @@ inline val KCallable<*>.valueParameters: List /** * Returns the parameter of this callable with the given name, or `null` if there's no such parameter. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'findParameterByName' from kotlin.reflect.full package", ReplaceWith("this.findParameterByName", "kotlin.reflect.full.findParameterByName"), level = DeprecationLevel.ERROR) @SinceKotlin("1.1") inline fun KCallable<*>.findParameterByName(name: String): KParameter? { diff --git a/core/reflection.jvm/src/kotlin/reflect/KClasses.kt b/core/reflection.jvm/src/kotlin/reflect/KClasses.kt index a2dfd049335..c6f9a44db64 100644 --- a/core/reflection.jvm/src/kotlin/reflect/KClasses.kt +++ b/core/reflection.jvm/src/kotlin/reflect/KClasses.kt @@ -15,7 +15,7 @@ */ @file:JvmName("KClasses") -@file:Suppress("UNCHECKED_CAST") +@file:Suppress("UNCHECKED_CAST", "INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") package kotlin.reflect @@ -50,6 +50,7 @@ import kotlin.reflect.full.superclasses * See the [Kotlin language documentation](http://kotlinlang.org/docs/reference/classes.html#constructors) * for more information. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'primaryConstructor' from kotlin.reflect.full package", ReplaceWith("this.primaryConstructor", "kotlin.reflect.full.primaryConstructor"), level = DeprecationLevel.WARNING) inline val KClass.primaryConstructor: KFunction? get() = this.primaryConstructor @@ -59,6 +60,7 @@ inline val KClass.primaryConstructor: KFunction? * Returns a [KClass] instance representing the companion object of a given class, * or `null` if the class doesn't have a companion object. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'companionObject' from kotlin.reflect.full package", ReplaceWith("this.companionObject", "kotlin.reflect.full.companionObject"), level = DeprecationLevel.WARNING) inline val KClass<*>.companionObject: KClass<*>? get() = this.companionObject @@ -67,6 +69,7 @@ inline val KClass<*>.companionObject: KClass<*>? * Returns an instance of the companion object of a given class, * or `null` if the class doesn't have a companion object. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'companionObjectInstance' from kotlin.reflect.full package", ReplaceWith("this.companionObjectInstance", "kotlin.reflect.full.companionObjectInstance"), level = DeprecationLevel.WARNING) inline val KClass<*>.companionObjectInstance: Any? get() = this.companionObjectInstance @@ -76,6 +79,7 @@ inline val KClass<*>.companionObjectInstance: Any? * Returns a type corresponding to the given class with type parameters of that class substituted as the corresponding arguments. * For example, for class `MyMap` [defaultType] would return the type `MyMap`. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'defaultType' from kotlin.reflect.full package", ReplaceWith("this.defaultType", "kotlin.reflect.full.defaultType"), level = DeprecationLevel.WARNING) inline val KClass<*>.defaultType: KType get() = this.defaultType @@ -86,6 +90,7 @@ inline val KClass<*>.defaultType: KType * Does not include members declared in supertypes. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'declaredMembers' from kotlin.reflect.full package", ReplaceWith("this.declaredMembers", "kotlin.reflect.full.declaredMembers"), level = DeprecationLevel.ERROR) inline val KClass<*>.declaredMembers: Collection> get() = this.declaredMembers @@ -94,6 +99,7 @@ inline val KClass<*>.declaredMembers: Collection> * Returns all functions declared in this class, including all non-static methods declared in the class * and the superclasses, as well as static methods declared in the class. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'functions' from kotlin.reflect.full package", ReplaceWith("this.functions", "kotlin.reflect.full.functions"), level = DeprecationLevel.WARNING) inline val KClass<*>.functions: Collection> get() = this.functions @@ -101,6 +107,7 @@ inline val KClass<*>.functions: Collection> /** * Returns static functions declared in this class. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'staticFunctions' from kotlin.reflect.full package", ReplaceWith("this.staticFunctions", "kotlin.reflect.full.staticFunctions"), level = DeprecationLevel.WARNING) inline val KClass<*>.staticFunctions: Collection> get() = this.staticFunctions @@ -108,6 +115,7 @@ inline val KClass<*>.staticFunctions: Collection> /** * Returns non-extension non-static functions declared in this class and all of its superclasses. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'memberFunctions' from kotlin.reflect.full package", ReplaceWith("this.memberFunctions", "kotlin.reflect.full.memberFunctions"), level = DeprecationLevel.WARNING) inline val KClass<*>.memberFunctions: Collection> get() = this.memberFunctions @@ -115,6 +123,7 @@ inline val KClass<*>.memberFunctions: Collection> /** * Returns extension functions declared in this class and all of its superclasses. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'memberExtensionFunctions' from kotlin.reflect.full package", ReplaceWith("this.memberExtensionFunctions", "kotlin.reflect.full.memberExtensionFunctions"), level = DeprecationLevel.WARNING) inline val KClass<*>.memberExtensionFunctions: Collection> get() = this.memberExtensionFunctions @@ -124,6 +133,7 @@ inline val KClass<*>.memberExtensionFunctions: Collection> * If this is a Java class, it includes all non-static methods (both extensions and non-extensions) * declared in the class and the superclasses, as well as static methods declared in the class. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'declaredFunctions' from kotlin.reflect.full package", ReplaceWith("this.declaredFunctions", "kotlin.reflect.full.declaredFunctions"), level = DeprecationLevel.WARNING) inline val KClass<*>.declaredFunctions: Collection> get() = this.declaredFunctions @@ -131,6 +141,7 @@ inline val KClass<*>.declaredFunctions: Collection> /** * Returns non-extension non-static functions declared in this class. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'declaredMemberFunctions' from kotlin.reflect.full package", ReplaceWith("this.declaredMemberFunctions", "kotlin.reflect.full.declaredMemberFunctions"), level = DeprecationLevel.WARNING) inline val KClass<*>.declaredMemberFunctions: Collection> get() = this.declaredMemberFunctions @@ -138,6 +149,7 @@ inline val KClass<*>.declaredMemberFunctions: Collection> /** * Returns extension functions declared in this class. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'declaredMemberExtensionFunctions' from kotlin.reflect.full package", ReplaceWith("this.declaredMemberExtensionFunctions", "kotlin.reflect.full.declaredMemberExtensionFunctions"), level = DeprecationLevel.WARNING) inline val KClass<*>.declaredMemberExtensionFunctions: Collection> get() = this.declaredMemberExtensionFunctions @@ -146,6 +158,7 @@ inline val KClass<*>.declaredMemberExtensionFunctions: Collection> * Returns static properties declared in this class. * Only properties representing static fields of Java classes are considered static. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'staticProperties' from kotlin.reflect.full package", ReplaceWith("this.staticProperties", "kotlin.reflect.full.staticProperties"), level = DeprecationLevel.WARNING) inline val KClass<*>.staticProperties: Collection> get() = this.staticProperties @@ -153,6 +166,7 @@ inline val KClass<*>.staticProperties: Collection> /** * Returns non-extension properties declared in this class and all of its superclasses. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'memberProperties' from kotlin.reflect.full package", ReplaceWith("this.memberProperties", "kotlin.reflect.full.memberProperties"), level = DeprecationLevel.WARNING) inline val KClass.memberProperties: Collection> get() = this.memberProperties @@ -160,6 +174,7 @@ inline val KClass.memberProperties: Collection> /** * Returns extension properties declared in this class and all of its superclasses. */ +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'memberExtensionProperties' from kotlin.reflect.full package", ReplaceWith("this.memberExtensionProperties", "kotlin.reflect.full.memberExtensionProperties"), level = DeprecationLevel.WARNING) inline val KClass.memberExtensionProperties: Collection> get() = this.memberExtensionProperties @@ -167,6 +182,7 @@ inline val KClass.memberExtensionProperties: Collection KClass.declaredMemberProperties: Collection> get() = this.declaredMemberProperties @@ -174,6 +190,7 @@ inline val KClass.declaredMemberProperties: Collection KClass.declaredMemberExtensionProperties: Collection> get() = this.declaredMemberExtensionProperties @@ -184,6 +201,7 @@ inline val KClass.declaredMemberExtensionProperties: Collection.superclasses: List> get() = this.superclasses @@ -193,6 +211,7 @@ inline val KClass<*>.superclasses: List> * There is not more than one type in the returned collection that has any given classifier. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'allSupertypes' from kotlin.reflect.full package", ReplaceWith("this.allSupertypes", "kotlin.reflect.full.allSupertypes"), level = DeprecationLevel.ERROR) inline val KClass<*>.allSupertypes: Collection get() = this.allSupertypes @@ -202,6 +221,7 @@ inline val KClass<*>.allSupertypes: Collection * The returned collection does not contain more than one instance of any given class. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'allSuperclasses' from kotlin.reflect.full package", ReplaceWith("this.allSuperclasses", "kotlin.reflect.full.allSuperclasses"), level = DeprecationLevel.ERROR) inline val KClass<*>.allSuperclasses: Collection> get() = this.allSuperclasses @@ -209,6 +229,7 @@ inline val KClass<*>.allSuperclasses: Collection> * Returns `true` if `this` class is the same or is a (possibly indirect) subclass of [base], `false` otherwise. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'isSubclassOf' from kotlin.reflect.full package", ReplaceWith("this.isSubclassOf(base)", "kotlin.reflect.full.isSubclassOf"), level = DeprecationLevel.ERROR) inline fun KClass<*>.isSubclassOf(base: KClass<*>): Boolean = this.isSubclassOf(base) @@ -217,6 +238,7 @@ inline fun KClass<*>.isSubclassOf(base: KClass<*>): Boolean = * Returns `true` if `this` class is the same or is a (possibly indirect) superclass of [derived], `false` otherwise. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'isSuperclassOf' from kotlin.reflect.full package", ReplaceWith("this.isSuperclassOf(derived)", "kotlin.reflect.full.isSuperclassOf"), level = DeprecationLevel.ERROR) inline fun KClass<*>.isSuperclassOf(derived: KClass<*>): Boolean = this.isSuperclassOf(derived) @@ -230,6 +252,7 @@ inline fun KClass<*>.isSuperclassOf(derived: KClass<*>): Boolean = * @see [KClass.safeCast] */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'cast' from kotlin.reflect.full package", ReplaceWith("this.cast(value)", "kotlin.reflect.full.cast"), level = DeprecationLevel.ERROR) inline fun KClass.cast(value: Any?): T { return this.cast(value) @@ -243,6 +266,7 @@ inline fun KClass.cast(value: Any?): T { * @see [KClass.cast] */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'safeCast' from kotlin.reflect.full package", ReplaceWith("this.safeCast(value)", "kotlin.reflect.full.safeCast"), level = DeprecationLevel.ERROR) inline fun KClass.safeCast(value: Any?): T? { return this.safeCast(value) @@ -254,6 +278,7 @@ inline fun KClass.safeCast(value: Any?): T? { * (see [KParameter.isOptional]). If there are no or many such constructors, an exception is thrown. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'createInstance' from kotlin.reflect.full package", ReplaceWith("this.createInstance()", "kotlin.reflect.full.createInstance"), level = DeprecationLevel.ERROR) inline fun KClass.createInstance(): T { return this.createInstance() diff --git a/core/reflection.jvm/src/kotlin/reflect/KClassifiers.kt b/core/reflection.jvm/src/kotlin/reflect/KClassifiers.kt index 762eda29307..9d3ca1a29b8 100644 --- a/core/reflection.jvm/src/kotlin/reflect/KClassifiers.kt +++ b/core/reflection.jvm/src/kotlin/reflect/KClassifiers.kt @@ -15,6 +15,7 @@ */ @file:JvmName("KClassifiers") +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") package kotlin.reflect import kotlin.reflect.full.createType @@ -32,6 +33,7 @@ import kotlin.reflect.full.starProjectedType * not `inner`, or is declared on the top level. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'createType' from kotlin.reflect.full package", ReplaceWith("this.createType(arguments, nullable, annotations)", "kotlin.reflect.full.createType"), level = DeprecationLevel.ERROR) inline fun KClassifier.createType( arguments: List = emptyList(), @@ -46,6 +48,7 @@ inline fun KClassifier.createType( * @see [KClassifier.createType] */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'starProjectedType' from kotlin.reflect.full package", ReplaceWith("this.starProjectedType", "kotlin.reflect.full.starProjectedType"), level = DeprecationLevel.ERROR) inline val KClassifier.starProjectedType: KType get() = this.starProjectedType \ No newline at end of file diff --git a/core/reflection.jvm/src/kotlin/reflect/KTypes.kt b/core/reflection.jvm/src/kotlin/reflect/KTypes.kt index 60d8442a2d0..0848efe9194 100644 --- a/core/reflection.jvm/src/kotlin/reflect/KTypes.kt +++ b/core/reflection.jvm/src/kotlin/reflect/KTypes.kt @@ -15,6 +15,7 @@ */ @file:JvmName("KTypes") +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") package kotlin.reflect import kotlin.reflect.full.isSubtypeOf @@ -25,6 +26,7 @@ import kotlin.reflect.full.withNullability * Returns a new type with the same classifier, arguments and annotations as the given type, and with the given nullability. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'withNullability' from kotlin.reflect.full package", ReplaceWith("this.withNullability(nullable)", "kotlin.reflect.full.withNullability"), level = DeprecationLevel.ERROR) inline fun KType.withNullability(nullable: Boolean): KType = this.withNullability(nullable) @@ -33,6 +35,7 @@ inline fun KType.withNullability(nullable: Boolean): KType = this.withNullabilit * Returns `true` if `this` type is the same or is a subtype of [other], `false` otherwise. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'isSubtypeOf' from kotlin.reflect.full package", ReplaceWith("this.isSubtypeOf(other)", "kotlin.reflect.full.isSubtypeOf"), level = DeprecationLevel.ERROR) inline fun KType.isSubtypeOf(other: KType): Boolean = this.isSubtypeOf(other) @@ -40,5 +43,6 @@ inline fun KType.isSubtypeOf(other: KType): Boolean = this.isSubtypeOf(other) * Returns `true` if `this` type is the same or is a supertype of [other], `false` otherwise. */ @SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution @Deprecated("Use 'isSupertypeOf' from kotlin.reflect.full package", ReplaceWith("this.isSupertypeOf(other)", "kotlin.reflect.full.isSupertypeOf"), level = DeprecationLevel.ERROR) inline fun KType.isSupertypeOf(other: KType): Boolean = this.isSupertypeOf(other)