Redundant curly braces in string template: do not report labeled 'this'
#KT-35475 Fixed
This commit is contained in:
committed by
Dmitry Gridin
parent
80d29cdad1
commit
fabeca5955
@@ -542,8 +542,11 @@ fun KtModifierList.normalize(): KtModifierList {
|
||||
}
|
||||
}
|
||||
|
||||
fun KtBlockStringTemplateEntry.canDropBraces() =
|
||||
(expression is KtNameReferenceExpression || expression is KtThisExpression) && canPlaceAfterSimpleNameEntry(nextSibling)
|
||||
fun KtBlockStringTemplateEntry.canDropBraces(): Boolean {
|
||||
val expression = this.expression
|
||||
return (expression is KtNameReferenceExpression || (expression is KtThisExpression && expression.labelQualifier == null))
|
||||
&& canPlaceAfterSimpleNameEntry(nextSibling)
|
||||
}
|
||||
|
||||
fun KtBlockStringTemplateEntry.dropBraces(): KtSimpleNameStringTemplateEntry {
|
||||
val name = if (expression is KtThisExpression) {
|
||||
|
||||
Reference in New Issue
Block a user