Files
kotlin-fork/analysis/analysis-api/testData/components/compileTimeConstantProvider/evaluate/string_templateNonConst.kt
T
Justin Paupore fa517180b7 [AA-FIR] Add support for constant evaluation of string templates.
Support FirStringConcatenationCall in FirCompileTimeConstantEvaluator.
This allows string templates ("foo${bar}") to be evaluated as constants,
assuming the interpolated expressions are themselves constant.

In addition, fixes some handling bugs with KtConstantEvaluationMode,
where some expressions that are not valid in a `const val` declaration
were being supported for `CONSTANT_EXPRESSION_EVALUATION`, including
non-static final Java fields in FIR, and composite expressions of
non-const properties in FE1.0.
2023-02-15 16:45:22 +01:00

6 lines
228 B
Kotlin
Vendored

val QUESTION = "the ultimate question of life, the universe, and everything"
val ANSWER = 42
val QUESTION_MEANING = null
val MESSAGE = <expr>"The answer to ${QUESTION} is ${ANSWER}. The question is: ${QUESTION_MEANING}"</expr>