Do not rely on KotlinType.toString()
This commit is contained in:
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.psi.KtExpression
|
|||||||
import org.jetbrains.kotlin.psi.KtFile
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
import org.jetbrains.kotlin.psi.KtPsiFactory
|
import org.jetbrains.kotlin.psi.KtPsiFactory
|
||||||
import org.jetbrains.kotlin.psi.createExpressionByPattern
|
import org.jetbrains.kotlin.psi.createExpressionByPattern
|
||||||
|
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
|
|
||||||
class AddArrayOfTypeFix(expression: KtExpression, expectedType: KotlinType) : KotlinQuickFixAction<KtExpression>(expression) {
|
class AddArrayOfTypeFix(expression: KtExpression, expectedType: KotlinType) : KotlinQuickFixAction<KtExpression>(expression) {
|
||||||
@@ -31,8 +32,8 @@ class AddArrayOfTypeFix(expression: KtExpression, expectedType: KotlinType) : Ko
|
|||||||
"arrayOf"
|
"arrayOf"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val name = "$expectedType"
|
val typeName = DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(expectedType)
|
||||||
"${name.decapitalize()}Of"
|
"${typeName.decapitalize()}Of"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user