UAST: remove redundant override: expression list's evaluate()

The super function in `KotlinEvaluatableUElement` is almost same,
except for handling of `UnsignedErrorValueTypeConstant`.
Such handling was added later, so I assume the addition to this override
was missed. In any cases, this override is unnecessary.
This commit is contained in:
Jinseong Jeon
2021-06-14 14:10:52 -07:00
committed by Ilya Kirillov
parent 31d1c002c5
commit 2e58b57db9
@@ -17,9 +17,6 @@
package org.jetbrains.uast.kotlin
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.uast.UElement
import org.jetbrains.uast.UExpression
import org.jetbrains.uast.UExpressionList
@@ -27,23 +24,17 @@ import org.jetbrains.uast.UastSpecialExpressionKind
import org.jetbrains.uast.kotlin.kinds.KotlinSpecialExpressionKinds
open class KotlinUExpressionList(
override val sourcePsi: PsiElement?,
override val kind: UastSpecialExpressionKind, // original element
givenParent: UElement?
override val sourcePsi: PsiElement?,
override val kind: UastSpecialExpressionKind, // original element
givenParent: UElement?
) : KotlinAbstractUExpression(givenParent), UExpressionList, KotlinUElementWithType, KotlinEvaluatableUElement {
override lateinit var expressions: List<UExpression>
internal set
override fun evaluate(): Any? {
val ktElement = sourcePsi as? KtExpression ?: return null
val compileTimeConst = ktElement.analyze()[BindingContext.COMPILE_TIME_VALUE, ktElement]
return compileTimeConst?.getValue(TypeUtils.NO_EXPECTED_TYPE)
}
companion object {
fun createClassBody(psi: PsiElement?, uastParent: UElement?): KotlinUExpressionList =
KotlinUExpressionList(psi, KotlinSpecialExpressionKinds.CLASS_BODY, uastParent).apply {
expressions = emptyList()
}
KotlinUExpressionList(psi, KotlinSpecialExpressionKinds.CLASS_BODY, uastParent).apply {
expressions = emptyList()
}
}
}