Add bodyBlockExpression() helper function to KtDeclarationWithBody

This commit is contained in:
Nikolay Krasko
2018-11-08 16:02:11 +03:00
parent 2b8a81c5a8
commit 2284028bbe
19 changed files with 45 additions and 36 deletions
@@ -237,7 +237,7 @@ fun definePackageAlias(name: String, varName: JsName, tag: String, parentRef: Js
val PsiElement.finalElement: PsiElement
get() = when (this) {
is KtFunctionLiteral -> rBrace ?: this
is KtDeclarationWithBody -> (bodyExpression as? KtBlockExpression)?.rBrace ?: bodyExpression ?: this
is KtDeclarationWithBody -> bodyBlockExpression?.rBrace ?: bodyExpression ?: this
is KtLambdaExpression -> bodyExpression?.rBrace ?: this
else -> this
}