mirror of
https://github.com/fankes/moshi.git
synced 2025-10-18 23:49: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 superTypes = appliedType.supertypes(types)
|
||||
.filterNot { supertype ->
|
||||
@Suppress("DEPRECATION") // Appropriate in this case
|
||||
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.
|
||||
}
|
||||
@@ -270,6 +271,7 @@ internal fun targetType(
|
||||
val superSuperClass = supertype.element.superclass as DeclaredType
|
||||
|
||||
// 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
|
||||
resolvedTypes += ResolvedTypeMapping(
|
||||
target = untyped.rawType,
|
||||
@@ -285,6 +287,7 @@ internal fun targetType(
|
||||
}
|
||||
|
||||
for ((localAppliedType, supertypeApi) in superTypes.entries) {
|
||||
@Suppress("DEPRECATION") // Appropriate in this case
|
||||
val appliedClassName = localAppliedType.element.asClassName()
|
||||
val supertypeProperties = declaredProperties(
|
||||
constructor = constructor,
|
||||
@@ -311,6 +314,8 @@ internal fun targetType(
|
||||
.any { it.isInternal }
|
||||
if (forceInternal) KModifier.INTERNAL else visibility
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION") // Appropriate in this case
|
||||
return TargetType(
|
||||
typeName = element.asType().asTypeName(),
|
||||
constructor = constructor,
|
||||
|
Reference in New Issue
Block a user