org.jetbrains.kotlin.analysis.api.evaluation¶
Functions¶
evaluate¶
context(session: KaSession)
fun KtExpression.evaluate(): KaConstantValue?
Attempts to evaluate the given KtExpression to a compile-time constant value, or returns null if this is not possible.
evaluateAsAnnotationValue¶
context(session: KaSession)
fun KtExpression.evaluateAsAnnotationValue(): KaAnnotationValue?
Attempts to evaluate the given KtExpression to an annotation value (a constant value which can be used as an annotation argument), or returns null if this is not possible.