Restore API used in Android safeArg plugin
See IDEA/f53c2114c38f856bdf0ff4d01de9fffeeeb630f2 commit.
In 222+ IDEA usage of the old ErrorUtils (and other classes)
was eliminated, but not in the 211-221 versions.
Relevant Kotlin commit: b5933c70e2
Also, there is usages of UnresolvedType or ErrorType from
the org.jetbrains.kotlin.types package in the safeargs tests,
but it is difficult to restore the compatibility for them.
So, I decided that it is ok to eliminate them in the
`kt-[212|213|221]-*` branches, because it is tests and not
production
This commit is contained in:
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.declaresOrInheritsDefaultValu
|
|||||||
import org.jetbrains.kotlin.types.*
|
import org.jetbrains.kotlin.types.*
|
||||||
import org.jetbrains.kotlin.types.TypeUtils.CANNOT_INFER_FUNCTION_PARAM_TYPE
|
import org.jetbrains.kotlin.types.TypeUtils.CANNOT_INFER_FUNCTION_PARAM_TYPE
|
||||||
import org.jetbrains.kotlin.types.error.*
|
import org.jetbrains.kotlin.types.error.*
|
||||||
|
import org.jetbrains.kotlin.types.error.ErrorUtils
|
||||||
import org.jetbrains.kotlin.types.typeUtil.isUnresolvedType
|
import org.jetbrains.kotlin.types.typeUtil.isUnresolvedType
|
||||||
import org.jetbrains.kotlin.util.capitalizeDecapitalize.toLowerCaseAsciiOnly
|
import org.jetbrains.kotlin.util.capitalizeDecapitalize.toLowerCaseAsciiOnly
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.types
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.types.error.ErrorTypeKind
|
||||||
|
import org.jetbrains.kotlin.utils.IDEAPlatforms.*
|
||||||
|
import org.jetbrains.kotlin.utils.IDEAPluginsCompatibilityAPI
|
||||||
|
|
||||||
|
@Suppress("unused", "UNUSED_PARAMETER")
|
||||||
|
@IDEAPluginsCompatibilityAPI(
|
||||||
|
_212, _213, _221,
|
||||||
|
message = "Please migrate to the org.jetbrains.kotlin.types.error.ErrorUtils",
|
||||||
|
plugins = "android/safeargs"
|
||||||
|
)
|
||||||
|
object ErrorUtils {
|
||||||
|
@IDEAPluginsCompatibilityAPI(
|
||||||
|
_212, _213, _221,
|
||||||
|
message = "Please migrate to the org.jetbrains.kotlin.types.error.ErrorUtils",
|
||||||
|
plugins = "android/safeargs"
|
||||||
|
)
|
||||||
|
@JvmStatic
|
||||||
|
fun createUnresolvedType(presentableName: String, arguments: List<TypeProjection>): SimpleType {
|
||||||
|
return org.jetbrains.kotlin.types.error.ErrorUtils.createErrorType(ErrorTypeKind.UNRESOLVED_TYPE, this.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user