FIR/UAST: commonoize array access expression

This commit is contained in:
Jinseong Jeon
2021-06-01 16:16:02 -07:00
committed by teamcityserver
parent ef8eddf1da
commit 1517fd0ca0
5 changed files with 56 additions and 14 deletions
@@ -0,0 +1,25 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.uast.kotlin
import org.jetbrains.kotlin.psi.KtArrayAccessExpression
import org.jetbrains.uast.UArrayAccessExpression
import org.jetbrains.uast.UElement
abstract class KotlinAbstractUArrayAccessExpression(
override val sourcePsi: KtArrayAccessExpression,
givenParent: UElement?
) : KotlinAbstractUExpression(givenParent), UArrayAccessExpression, KotlinUElementWithType, KotlinEvaluatableUElement {
override val receiver by lz {
baseResolveProviderService.baseKotlinConverter.convertOrEmpty(sourcePsi.arrayExpression, this)
}
override val indices by lz {
sourcePsi.indexExpressions.map {
baseResolveProviderService.baseKotlinConverter.convertOrEmpty(it, this)
}
}
}