[FIR] Allow annotation instantiation.

This commit disables the frontend error reporting for supported cases.
This commit is contained in:
Mads Ager
2021-11-02 17:17:34 +01:00
committed by TeamCityServer
parent 56d472451c
commit b79ca7d7df
24 changed files with 32 additions and 78 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM_IR
// WITH_RUNTIME
@@ -50,4 +49,4 @@ fun box(): String {
test(G().insideClassAgain(), "test.E", "test_A1")
test(outsideClass(), "test.TestKt", "test_A2")
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS
@@ -29,4 +28,4 @@ fun box(): String {
if (barlike != foo1.bar.hashCode()) return "Failed HC1"
if (barlike != foo2.bar.hashCode()) return "Failed HC2"
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS
@@ -14,4 +13,4 @@ fun box(): String {
val actualToString = ann1.toString()
if (actualToString != expectedToString) return "Expected ann1.toString() equals to $expectedToString, but it's $actualToString"
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS
@@ -46,4 +45,4 @@ fun box(): String {
assertEquals("bar", p.s)
assertEquals(E.B, p.e)
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM_IR
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS
@@ -52,4 +51,4 @@ fun box(): String {
.replace(" (Kotlin reflection is not available)", "")
.replace("interface", "class")
return if (s == targetJS || s == targetJVM || s == targetNative) "OK" else "FAILED, got string $s"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM_IR
// WITH_RUNTIME
@@ -15,4 +14,4 @@ fun box(): String {
if (kClass != Foo::class) return "FAIL $kClass"
if (jClass != Foo::class.java) return "FAIL $jClass"
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS
@@ -28,4 +27,4 @@ fun box(): String {
assertEquals(A(1), one)
assertEquals(A(2), two)
return "OK"
}
}
@@ -1,3 +1,4 @@
// Fir2IrLazyClass does not handle methods from java dependencies in declarations.
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM_IR
@@ -41,4 +42,4 @@ fun box(): String {
// val d = D()
val d = D("OK").value
return d
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM_IR
// WITH_RUNTIME
@@ -20,4 +19,4 @@ fun box(): String {
if (m.toString() == """@kotlin.Metadata(bytecodeVersion=[1, 0, 3], data1=[], data2=[], extraInt=0, extraString=, kind=0, metadataVersion=[], packageName=foo)""")
return "OK"
return m.toString()
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS
@@ -27,4 +26,4 @@ fun box(): String {
if (here().hashCode() != createInOtherFile().hashCode()) return "Fail hashCode"
if (here().toString() != createInOtherFile().toString()) return "Fail toString"
return "OK"
}
}
@@ -1,7 +1,9 @@
// With FIR the annotation implementation class is not regenerated as it
// is seen as coming from the same module.
// See IrSourceCompilerForInline.kt:isCallInsideSameModuleAsCallee.
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM_IR
// IGNORE_DEXING
// WITH_RUNTIME
// !LANGUAGE: +InstantiationOfAnnotationClasses
@@ -39,4 +41,4 @@ fun box(): String {
assert(one.javaClass.getEnclosingClass().getName() == "test.C")
assert(two.javaClass.getEnclosingClass().getName() == "test.C")
return "OK"
}
}
@@ -1,3 +1,4 @@
// Multi-platform not supported with FIR yet.
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
@@ -30,4 +31,4 @@ fun box(): String {
if (createCommon().value != "OK") return "FAIL common"
if (createPlatform().value != "OK") return "FAIL platform"
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS