From 7f1e7e229e5c58506d9d11ded2605750d43aae22 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Sat, 20 Feb 2021 23:27:56 -0500 Subject: [PATCH] Suppress some poet deprecations (#1306) --- .../main/java/com/squareup/moshi/kotlin/codegen/metadata.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/metadata.kt b/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/metadata.kt index b3bdd11..349518b 100644 --- a/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/metadata.kt +++ b/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/metadata.kt @@ -231,6 +231,7 @@ internal fun targetType( val resolvedTypes = mutableListOf() 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,