Minor: replace deprecated function call

This commit is contained in:
Natalia Ukhorskaya
2014-12-19 13:41:21 +03:00
parent 0dcb5b05b6
commit 1422cc4794
@@ -198,19 +198,19 @@ private fun addDebugExpressionBeforeContextElement(codeFragment: JetCodeFragment
}
contextElement is JetFunctionLiteral -> {
val block = contextElement.getBodyExpression()!!
block.getStatements().first ?: block.getLastChild()
block.getStatements().firstOrNull() ?: block.getLastChild()
}
contextElement is JetDeclarationWithBody && !contextElement.hasBlockBody()-> {
wrapInRunFun(contextElement.getBodyExpression()!!)
}
contextElement is JetDeclarationWithBody && contextElement.hasBlockBody()-> {
val block = contextElement.getBodyExpression() as JetBlockExpression
block.getStatements().first ?: block.getLastChild()
block.getStatements().firstOrNull() ?: block.getLastChild()
}
contextElement is JetWhenEntry -> {
val entryExpression = contextElement.getExpression()
if (entryExpression is JetBlockExpression) {
entryExpression.getStatements().first ?: entryExpression.getLastChild()
entryExpression.getStatements().firstOrNull() ?: entryExpression.getLastChild()
}
else {
wrapInRunFun(entryExpression!!)