Move JVM8 box test to common

This commit is contained in:
Mikhael Bogdanov
2018-10-16 11:06:27 +02:00
parent b61608aba7
commit ac8e1a0124
110 changed files with 0 additions and 0 deletions
@@ -0,0 +1,19 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FULL_JDK
// KOTLIN_CONFIGURATION_FLAGS: +JVM.PARAMETERS_METADATA
open class A(val s: String)
fun test(OK: String) = object : A(OK) {
}
fun box(): String {
val value = test("OK")
val clazz = value.javaClass
val constructor = clazz.getDeclaredConstructors().single()
val parameters = constructor.getParameters()
if (!parameters[0].isSynthetic() || parameters[0].isImplicit()) return "wrong modifier on value parameter: ${parameters[0].modifiers}"
return value.s
}