[IR] Add test to specify new logic of enum initialization with name call

#KT-58948
#KT-57538
This commit is contained in:
Ivan Kylchik
2023-05-27 00:49:12 +02:00
committed by Space Team
parent 60016d3e5b
commit fc75402f65
5 changed files with 44 additions and 0 deletions
@@ -0,0 +1,20 @@
// !LANGUAGE: +IntrinsicConstEvaluation
// TARGET_BACKEND: JVM_IR
fun <T> T.id() = this
var result = "OK"
enum class EnumClass {
OK;
init {
result = "Fail"
}
}
// STOP_EVALUATION_CHECKS
fun box(): String {
if (EnumClass.OK.name.id() != "OK") return "Fail 1"
return result
}