Do not rely on KotlinType.toString()

This commit is contained in:
Valentin Kipyatkov
2016-03-29 18:26:27 +03:00
parent 1754b58e37
commit d8993069c0
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.psi.createExpressionByPattern
import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.types.KotlinType
class AddArrayOfTypeFix(expression: KtExpression, expectedType: KotlinType) : KotlinQuickFixAction<KtExpression>(expression) {
@@ -31,8 +32,8 @@ class AddArrayOfTypeFix(expression: KtExpression, expectedType: KotlinType) : Ko
"arrayOf"
}
else {
val name = "$expectedType"
"${name.decapitalize()}Of"
val typeName = DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(expectedType)
"${typeName.decapitalize()}Of"
}