KT-28054: Treat inline class constructor accessors specially
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
inline class Composed(val s: String) {
|
||||
private constructor(s1: String, s2: String) : this(s1 + s2)
|
||||
|
||||
companion object {
|
||||
fun p1(s: String) = Composed("O", s)
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Composed.p1("K").s
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
inline class Composed(val s: String) {
|
||||
|
||||
constructor(s: String, x: Int) : this(s.subSequence(0, x).toString())
|
||||
|
||||
private constructor(s1: String, s2: String) : this(s1 + s2, 2)
|
||||
|
||||
fun p1(s2: String) =
|
||||
{ Composed(s, s2) }
|
||||
}
|
||||
|
||||
fun box() = Composed("O").p1("K1234")().s
|
||||
Reference in New Issue
Block a user