Remove unsafe cast function usages from compiler plugins

This commit is contained in:
Alexander Udalov
2022-11-01 14:42:29 +01:00
committed by Space Team
parent fd9b19ee49
commit 0d8d91f803
7 changed files with 17 additions and 22 deletions
@@ -31,7 +31,6 @@ import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.isError
import org.jetbrains.kotlin.types.typeUtil.representativeUpperBound
import org.jetbrains.kotlin.types.typeUtil.supertypes
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
open class ParcelizeDeclarationChecker : DeclarationChecker {
private companion object {
@@ -290,7 +289,7 @@ open class ParcelizeDeclarationChecker : DeclarationChecker {
}
private fun KotlinType.getErasedUpperBound(): KotlinType =
constructor.declarationDescriptor?.safeAs<TypeParameterDescriptor>()?.representativeUpperBound?.getErasedUpperBound()
(constructor.declarationDescriptor as? TypeParameterDescriptor)?.representativeUpperBound?.getErasedUpperBound()
?: this
private fun ClassDescriptor.hasCustomParceler(): Boolean {