mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Suppress some poet deprecations (#1306)
This commit is contained in:
@@ -231,6 +231,7 @@ internal fun targetType(
|
|||||||
val resolvedTypes = mutableListOf<ResolvedTypeMapping>()
|
val resolvedTypes = mutableListOf<ResolvedTypeMapping>()
|
||||||
val superTypes = appliedType.supertypes(types)
|
val superTypes = appliedType.supertypes(types)
|
||||||
.filterNot { supertype ->
|
.filterNot { supertype ->
|
||||||
|
@Suppress("DEPRECATION") // Appropriate in this case
|
||||||
supertype.element.asClassName() == OBJECT_CLASS || // Don't load properties for java.lang.Object.
|
supertype.element.asClassName() == OBJECT_CLASS || // Don't load properties for java.lang.Object.
|
||||||
supertype.element.kind != ElementKind.CLASS // Don't load properties for interface types.
|
supertype.element.kind != ElementKind.CLASS // Don't load properties for interface types.
|
||||||
}
|
}
|
||||||
@@ -270,6 +271,7 @@ internal fun targetType(
|
|||||||
val superSuperClass = supertype.element.superclass as DeclaredType
|
val superSuperClass = supertype.element.superclass as DeclaredType
|
||||||
|
|
||||||
// Convert to an element and back to wipe the typed generics off of this
|
// Convert to an element and back to wipe the typed generics off of this
|
||||||
|
@Suppress("DEPRECATION") // Appropriate in this case
|
||||||
val untyped = superSuperClass.asElement().asType().asTypeName() as ParameterizedTypeName
|
val untyped = superSuperClass.asElement().asType().asTypeName() as ParameterizedTypeName
|
||||||
resolvedTypes += ResolvedTypeMapping(
|
resolvedTypes += ResolvedTypeMapping(
|
||||||
target = untyped.rawType,
|
target = untyped.rawType,
|
||||||
@@ -285,6 +287,7 @@ internal fun targetType(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for ((localAppliedType, supertypeApi) in superTypes.entries) {
|
for ((localAppliedType, supertypeApi) in superTypes.entries) {
|
||||||
|
@Suppress("DEPRECATION") // Appropriate in this case
|
||||||
val appliedClassName = localAppliedType.element.asClassName()
|
val appliedClassName = localAppliedType.element.asClassName()
|
||||||
val supertypeProperties = declaredProperties(
|
val supertypeProperties = declaredProperties(
|
||||||
constructor = constructor,
|
constructor = constructor,
|
||||||
@@ -311,6 +314,8 @@ internal fun targetType(
|
|||||||
.any { it.isInternal }
|
.any { it.isInternal }
|
||||||
if (forceInternal) KModifier.INTERNAL else visibility
|
if (forceInternal) KModifier.INTERNAL else visibility
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION") // Appropriate in this case
|
||||||
return TargetType(
|
return TargetType(
|
||||||
typeName = element.asType().asTypeName(),
|
typeName = element.asType().asTypeName(),
|
||||||
constructor = constructor,
|
constructor = constructor,
|
||||||
|
Reference in New Issue
Block a user