[K/N] Implement instantiating of annotation class

This commit is contained in:
Pavel Kunyavskiy
2021-09-21 16:12:53 +03:00
committed by Space
parent a40022efcd
commit fb875c484d
33 changed files with 260 additions and 123 deletions
@@ -1,6 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS
@@ -49,5 +48,8 @@ fun box(): String {
val targetJVM = "@test.Anno(s=OK, i=42, f=2.718281828, u=43, e=E0, a=@test.A(b=1, s=1, i=1, f=1.0, d=1.0, l=1, c=c, bool=true), " +
"k=interface test.A (Kotlin reflection is not available), arr=[], intArr=[1, 2], arrOfE=[E0], arrOfA=[@test.Empty()])"
val targetJS = "@test.Anno(s=OK, i=42, f=2.718281828, u=43, e=E0, a=@test.A(b=1, s=1, i=1, f=1, d=1, l=1, c=c, bool=true), k=class A, arr=[...], intArr=[...], arrOfE=[...], arrOfA=[...])"
return if (s == targetJS || s == targetJVM) "OK" else "FAILED, got string $s"
val targetNative = targetJVM
.replace(" (Kotlin reflection is not available)", "")
.replace("interface", "class")
return if (s == targetJS || s == targetJVM || s == targetNative) "OK" else "FAILED, got string $s"
}