Allow secondary constructors without body

#KT-6967 Fixed
This commit is contained in:
Denis Zharkov
2015-03-20 12:59:05 +03:00
parent 3f0541924f
commit 01e5ee718f
54 changed files with 390 additions and 153 deletions
@@ -11,7 +11,7 @@ class A(val result: Int) {
object C {
}
constructor() : this(foo() + prop + B.bar() + B.prop + C) {}
constructor() : this(foo() + prop + B.bar() + B.prop + C)
}
fun box(): String {
@@ -1,13 +1,13 @@
open class A(val x: String = "abc", val y: String = "efg") {
constructor(x: String, y: String, z: Int): this(x, y + "#" + z.toString()) {}
constructor(x: String, y: String, z: Int): this(x, y + "#" + z.toString())
override fun toString() = "$x#$y"
}
class B : A {
constructor(x: String, y: String, z: Int): super(x, y + z.toString()) {}
constructor(x: String = "xyz", y: String = "123") : super(x, y) {}
constructor(x: Double): super(x.toString()) {}
constructor(x: String, y: String, z: Int): super(x, y + z.toString())
constructor(x: String = "xyz", y: String = "123") : super(x, y)
constructor(x: Double): super(x.toString())
}
fun box(): String {
@@ -9,7 +9,7 @@ class B : A {
val global = B()
class C(x: Int) : A by global {
constructor(): this(1) {}
constructor(): this(1)
}
fun box(): String {
@@ -1,11 +1,11 @@
open class B<T>(val x: T, val y: T) {
constructor(x: T): this(x, x) {}
constructor(x: T): this(x, x)
override fun toString() = "$x#$y"
}
class A : B<String> {
constructor(): super("default") {}
constructor(x: String): super(x, "default") {}
constructor(): super("default")
constructor(x: String): super(x, "default")
}
fun box(): String {