Files
kotlin/compiler/testData/codegen/bytecodeListing/inlineClasses/annotationsOnHiddenConstructor.kt
Dmitry Petrov 1b519b340e Generate metadata and annotations for hidden constructor
Reflection expects to see a callable method for a hidden constructor,
thus, it should be a synthetic accessor.
JVM method signature in metadata should point to the synthetic accessor.
Annotations for hidden constructor should be written on the synthetic
accessor.
2018-09-12 15:37:20 +03:00

18 lines
507 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
annotation class Ann
inline class Z(val x: Int)
class Test @Ann constructor(@Ann val z: Z) {
@Ann constructor(z: Z, @Ann a: Int) : this(z)
@Ann private constructor(z: Z, @Ann s: String) : this(z)
inner class Inner @Ann constructor(x: Int, @Ann val z2: Z, @Ann y: String)
}
sealed class Sealed @Ann constructor(@Ann val z: Z) {
class Derived @Ann constructor(z: Z) : Sealed(z)
inner class Inner @Ann constructor(x: Int, @Ann val z2: Z, @Ann y: String)
}