Change Signature: Parenthesize functional type of receiver in the signature preview

#KT-8737 Fixed
This commit is contained in:
Alexey Sedunov
2015-12-03 18:16:15 +03:00
parent 8f8acf7a83
commit d850d7bbad
2 changed files with 13 additions and 2 deletions
@@ -247,7 +247,13 @@ public open class KotlinChangeInfo(
if (kind == Kind.FUNCTION) {
receiverParameterInfo?.let {
buffer.append(it.currentTypeText).append('.')
// TODO: Temporary solution until Change Signature is able to infer actual KotlinType from code fragments instead of using text representation
if (KtPsiFactory(context).createTypeIfPossible(it.currentTypeText)?.typeElement is KtFunctionType) {
buffer.append("(${it.currentTypeText})")
} else {
buffer.append(it.currentTypeText)
}
buffer.append('.')
}
}