Files
kotlin-fork/compiler/testData/diagnostics/tests/valueClasses/constructorsJvmSignaturesClash.fir.kt
T
Ilmir Usmanov 129de76288 Value classes: Generate @JvmInline annotation for inline classes
but not for value classes.
Since inline classes and value classes share the same flag, we use
presence of the annotation to distinguish them.
2020-12-01 23:45:47 +01:00

24 lines
450 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
package kotlin.jvm
annotation class JvmInline
@JvmInline
value class X(val x: Int)
@JvmInline
value class Z(val x: Int)
class TestOk1(val a: Int, val b: Int) {
constructor(x: X) : this(x.x, 1)
}
class TestErr1(val a: Int) {
constructor(x: X) : this(x.x)
}
class TestErr2(val a: Int, val b: Int) {
constructor(x: X) : this(x.x, 1)
constructor(z: Z) : this(z.x, 2)
}