Files
kotlin-fork/compiler/testData/codegen/box/annotations/instances/annotationFromStdlib.kt
T
Mads Ager b79ca7d7df [FIR] Allow annotation instantiation.
This commit disables the frontend error reporting for supported cases.
2021-11-09 23:51:48 +03:00

17 lines
494 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS
// WITH_RUNTIME
// !LANGUAGE: +InstantiationOfAnnotationClasses
import kotlin.reflect.KClass
fun box(): String {
val ann1 = kotlin.SinceKotlin("1.6.0")
val expectedToString = "@kotlin.SinceKotlin(version=1.6.0)"
val actualToString = ann1.toString()
if (actualToString != expectedToString) return "Expected ann1.toString() equals to $expectedToString, but it's $actualToString"
return "OK"
}