Deprecate moved reflection 1.1 api with ERROR

This commit is contained in:
Ilya Gorbunov
2016-12-22 21:18:32 +03:00
parent af1b7c49b4
commit 7696d20adf
4 changed files with 18 additions and 18 deletions
@@ -26,7 +26,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.
*/
@Deprecated("Use 'instanceParameter' from kotlin.reflect.full package", ReplaceWith("this.instanceParameter", "kotlin.reflect.full.instanceParameter"), level = DeprecationLevel.WARNING)
@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?
get() = this.instanceParameter
@@ -35,7 +35,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.
*/
@Deprecated("Use 'extensionReceiverParameter' from kotlin.reflect.full package", ReplaceWith("this.extensionReceiverParameter", "kotlin.reflect.full.extensionReceiverParameter"), level = DeprecationLevel.WARNING)
@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?
get() = this.extensionReceiverParameter
@@ -43,7 +43,7 @@ inline val KCallable<*>.extensionReceiverParameter: KParameter?
/**
* Returns parameters of this callable, excluding the `this` instance and the extension receiver parameter.
*/
@Deprecated("Use 'valueParameters' from kotlin.reflect.full package", ReplaceWith("this.valueParameters", "kotlin.reflect.full.valueParameters"), level = DeprecationLevel.WARNING)
@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<KParameter>
get() = this.valueParameters
@@ -51,7 +51,7 @@ inline val KCallable<*>.valueParameters: List<KParameter>
/**
* Returns the parameter of this callable with the given name, or `null` if there's no such parameter.
*/
@Deprecated("Use 'findParameterByName' from kotlin.reflect.full package", ReplaceWith("this.findParameterByName", "kotlin.reflect.full.findParameterByName"), level = DeprecationLevel.WARNING)
@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? {
return this.findParameterByName(name)
@@ -86,7 +86,7 @@ inline val KClass<*>.defaultType: KType
* Does not include members declared in supertypes.
*/
@SinceKotlin("1.1")
@Deprecated("Use 'declaredMembers' from kotlin.reflect.full package", ReplaceWith("this.declaredMembers", "kotlin.reflect.full.declaredMembers"), level = DeprecationLevel.WARNING)
@Deprecated("Use 'declaredMembers' from kotlin.reflect.full package", ReplaceWith("this.declaredMembers", "kotlin.reflect.full.declaredMembers"), level = DeprecationLevel.ERROR)
inline val KClass<*>.declaredMembers: Collection<KCallable<*>>
get() = this.declaredMembers
@@ -184,7 +184,7 @@ inline val <T : Any> KClass<T>.declaredMemberExtensionProperties: Collection<KPr
* Includes superclasses and superinterfaces of the class, but does not include the class itself.
*/
@SinceKotlin("1.1")
@Deprecated("Use 'superclasses' from kotlin.reflect.full package", ReplaceWith("this.superclasses", "kotlin.reflect.full.superclasses"), level = DeprecationLevel.WARNING)
@Deprecated("Use 'superclasses' from kotlin.reflect.full package", ReplaceWith("this.superclasses", "kotlin.reflect.full.superclasses"), level = DeprecationLevel.ERROR)
inline val KClass<*>.superclasses: List<KClass<*>>
get() = this.superclasses
@@ -193,7 +193,7 @@ inline val KClass<*>.superclasses: List<KClass<*>>
* There is not more than one type in the returned collection that has any given classifier.
*/
@SinceKotlin("1.1")
@Deprecated("Use 'allSupertypes' from kotlin.reflect.full package", ReplaceWith("this.allSupertypes", "kotlin.reflect.full.allSupertypes"), level = DeprecationLevel.WARNING)
@Deprecated("Use 'allSupertypes' from kotlin.reflect.full package", ReplaceWith("this.allSupertypes", "kotlin.reflect.full.allSupertypes"), level = DeprecationLevel.ERROR)
inline val KClass<*>.allSupertypes: Collection<KType>
get() = this.allSupertypes
/**
@@ -202,14 +202,14 @@ inline val KClass<*>.allSupertypes: Collection<KType>
* The returned collection does not contain more than one instance of any given class.
*/
@SinceKotlin("1.1")
@Deprecated("Use 'allSuperclasses' from kotlin.reflect.full package", ReplaceWith("this.allSuperclasses", "kotlin.reflect.full.allSuperclasses"), level = DeprecationLevel.WARNING)
@Deprecated("Use 'allSuperclasses' from kotlin.reflect.full package", ReplaceWith("this.allSuperclasses", "kotlin.reflect.full.allSuperclasses"), level = DeprecationLevel.ERROR)
inline val KClass<*>.allSuperclasses: Collection<KClass<*>>
get() = this.allSuperclasses
/**
* Returns `true` if `this` class is the same or is a (possibly indirect) subclass of [base], `false` otherwise.
*/
@SinceKotlin("1.1")
@Deprecated("Use 'isSubclassOf' from kotlin.reflect.full package", ReplaceWith("this.isSubclassOf(base)", "kotlin.reflect.full.isSubclassOf"), level = DeprecationLevel.WARNING)
@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,7 +217,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")
@Deprecated("Use 'isSuperclassOf' from kotlin.reflect.full package", ReplaceWith("this.isSuperclassOf(derived)", "kotlin.reflect.full.isSuperclassOf"), level = DeprecationLevel.WARNING)
@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,7 +230,7 @@ inline fun KClass<*>.isSuperclassOf(derived: KClass<*>): Boolean =
* @see [KClass.safeCast]
*/
@SinceKotlin("1.1")
@Deprecated("Use 'cast' from kotlin.reflect.full package", ReplaceWith("this.cast(value)", "kotlin.reflect.full.cast"), level = DeprecationLevel.WARNING)
@Deprecated("Use 'cast' from kotlin.reflect.full package", ReplaceWith("this.cast(value)", "kotlin.reflect.full.cast"), level = DeprecationLevel.ERROR)
inline fun <T : Any> KClass<T>.cast(value: Any?): T {
return this.cast(value)
}
@@ -243,7 +243,7 @@ inline fun <T : Any> KClass<T>.cast(value: Any?): T {
* @see [KClass.cast]
*/
@SinceKotlin("1.1")
@Deprecated("Use 'safeCast' from kotlin.reflect.full package", ReplaceWith("this.safeCast(value)", "kotlin.reflect.full.safeCast"), level = DeprecationLevel.WARNING)
@Deprecated("Use 'safeCast' from kotlin.reflect.full package", ReplaceWith("this.safeCast(value)", "kotlin.reflect.full.safeCast"), level = DeprecationLevel.ERROR)
inline fun <T : Any> KClass<T>.safeCast(value: Any?): T? {
return this.safeCast(value)
}
@@ -254,7 +254,7 @@ inline fun <T : Any> KClass<T>.safeCast(value: Any?): T? {
* (see [KParameter.isOptional]). If there are no or many such constructors, an exception is thrown.
*/
@SinceKotlin("1.1")
@Deprecated("Use 'createInstance' from kotlin.reflect.full package", ReplaceWith("this.createInstance()", "kotlin.reflect.full.createInstance"), level = DeprecationLevel.WARNING)
@Deprecated("Use 'createInstance' from kotlin.reflect.full package", ReplaceWith("this.createInstance()", "kotlin.reflect.full.createInstance"), level = DeprecationLevel.ERROR)
inline fun <T : Any> KClass<T>.createInstance(): T {
return this.createInstance()
}
@@ -32,7 +32,7 @@ import kotlin.reflect.full.starProjectedType
* not `inner`, or is declared on the top level.
*/
@SinceKotlin("1.1")
@Deprecated("Use 'createType' from kotlin.reflect.full package", ReplaceWith("this.createType(arguments, nullable, annotations)", "kotlin.reflect.full.createType"), level = DeprecationLevel.WARNING)
@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<KTypeProjection> = emptyList(),
nullable: Boolean = false,
@@ -46,6 +46,6 @@ inline fun KClassifier.createType(
* @see [KClassifier.createType]
*/
@SinceKotlin("1.1")
@Deprecated("Use 'starProjectedType' from kotlin.reflect.full package", ReplaceWith("this.starProjectedType", "kotlin.reflect.full.starProjectedType"), level = DeprecationLevel.WARNING)
@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
@@ -25,7 +25,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")
@Deprecated("Use 'withNullability' from kotlin.reflect.full package", ReplaceWith("this.withNullability(nullable)", "kotlin.reflect.full.withNullability"), level = DeprecationLevel.WARNING)
@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,12 +33,12 @@ 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")
@Deprecated("Use 'isSubtypeOf' from kotlin.reflect.full package", ReplaceWith("this.isSubtypeOf(other)", "kotlin.reflect.full.isSubtypeOf"), level = DeprecationLevel.WARNING)
@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)
/**
* Returns `true` if `this` type is the same or is a supertype of [other], `false` otherwise.
*/
@SinceKotlin("1.1")
@Deprecated("Use 'isSupertypeOf' from kotlin.reflect.full package", ReplaceWith("this.isSupertypeOf(other)", "kotlin.reflect.full.isSupertypeOf"), level = DeprecationLevel.WARNING)
@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)