[FIR] Set proper return type for LighterASTNode.getChildren utility
This commit is contained in:
committed by
teamcityserver
parent
8cdddbfd9d
commit
6b330fb5d5
+2
-2
@@ -82,10 +82,10 @@ private val FILLER_TOKENS = setOf(
|
||||
)
|
||||
|
||||
private fun LighterASTNode.nonFillerFirstChildOrSelf(tree: FlyweightCapableTreeStructure<LighterASTNode>): LighterASTNode =
|
||||
getChildren(tree).firstOrNull { !(it?.isFiller() ?: false) } ?: this
|
||||
getChildren(tree).firstOrNull { !it.isFiller() } ?: this
|
||||
|
||||
internal fun LighterASTNode.nonFillerLastChildOrSelf(tree: FlyweightCapableTreeStructure<LighterASTNode>): LighterASTNode =
|
||||
getChildren(tree).lastOrNull { !(it?.isFiller() ?: false) } ?: this
|
||||
getChildren(tree).lastOrNull { !it.isFiller() } ?: this
|
||||
|
||||
internal fun LighterASTNode.isFiller() = tokenType in FILLER_TOKENS
|
||||
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ class UnreachableCodeLightTreeHelper(val tree: FlyweightCapableTreeStructure<Nod
|
||||
}
|
||||
}
|
||||
|
||||
internal fun LighterASTNode.getChildren(tree: FlyweightCapableTreeStructure<LighterASTNode>): List<LighterASTNode?> {
|
||||
internal fun LighterASTNode.getChildren(tree: FlyweightCapableTreeStructure<LighterASTNode>): List<LighterASTNode> {
|
||||
val children = Ref<Array<LighterASTNode?>>()
|
||||
val count = tree.getChildren(this, children)
|
||||
return if (count > 0) children.get().filterNotNull() else emptyList()
|
||||
|
||||
Reference in New Issue
Block a user