diff --git a/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/LightTreePositioningStrategy.kt b/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/LightTreePositioningStrategy.kt index abdc4c1f21f..d1372eec03d 100644 --- a/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/LightTreePositioningStrategy.kt +++ b/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/LightTreePositioningStrategy.kt @@ -82,10 +82,10 @@ private val FILLER_TOKENS = setOf( ) private fun LighterASTNode.nonFillerFirstChildOrSelf(tree: FlyweightCapableTreeStructure): LighterASTNode = - getChildren(tree).firstOrNull { !(it?.isFiller() ?: false) } ?: this + getChildren(tree).firstOrNull { !it.isFiller() } ?: this internal fun LighterASTNode.nonFillerLastChildOrSelf(tree: FlyweightCapableTreeStructure): LighterASTNode = - getChildren(tree).lastOrNull { !(it?.isFiller() ?: false) } ?: this + getChildren(tree).lastOrNull { !it.isFiller() } ?: this internal fun LighterASTNode.isFiller() = tokenType in FILLER_TOKENS diff --git a/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/UnreachableCodeLightTreeHelper.kt b/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/UnreachableCodeLightTreeHelper.kt index 946897926a6..14489a589a0 100644 --- a/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/UnreachableCodeLightTreeHelper.kt +++ b/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/UnreachableCodeLightTreeHelper.kt @@ -85,7 +85,7 @@ class UnreachableCodeLightTreeHelper(val tree: FlyweightCapableTreeStructure): List { +internal fun LighterASTNode.getChildren(tree: FlyweightCapableTreeStructure): List { val children = Ref>() val count = tree.getChildren(this, children) return if (count > 0) children.get().filterNotNull() else emptyList()