[FIR] Introduce special phase for resolve of enums and class literals

This commit is contained in:
Dmitriy Novozhilov
2021-07-28 15:17:17 +03:00
committed by TeamCityServer
parent afb85026c4
commit 71def0666e
12 changed files with 218 additions and 50 deletions
@@ -0,0 +1,30 @@
import kotlin.reflect.KClass
enum class SomeEnum {
A, B
}
annotation class MyAnnotation(
val intValue: Int,
val stringValue: String,
val enumValue: SomeEnum,
val kClasses: Array<out KClass<*>>,
val annotation: MyOtherAnnotation
)
annotation class MyOtherAnnotation(val intValue: Int, val stringValue: String)
const val constInt = 10
const val constString = ""
@MyAnnotation(
intValue = 10,
stringValue = constString,
enumValue = SomeEnum.A,
kClasses = [String::class, <!ANNOTATION_ARGUMENT_MUST_BE_KCLASS_LITERAL!>constString::class<!>],
annotation = MyOtherAnnotation(
intValue = constInt,
stringValue = "hello"
)
)
fun foo() {}