Suppress some poet deprecations (#1306)

This commit is contained in:
Zac Sweers
2021-02-20 23:27:56 -05:00
committed by GitHub
parent 99ebab66c0
commit 7f1e7e229e

View File

@@ -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,