mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-07 08:31:28 +00:00
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.
18 lines
507 B
Kotlin
Vendored
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)
|
|
} |