KT-12707: support case when secondary super constructor has optional parameters

This commit is contained in:
Alexey Andreev
2016-10-03 14:54:08 +03:00
parent c1b8e50734
commit 977fd8f591
5 changed files with 59 additions and 0 deletions
@@ -0,0 +1,11 @@
open class A(val result: String) {
constructor(x: Int = 11, y: Int = 22, z: Int = 33) : this("$x$y$z")
}
class B() : A(y = 44)
fun box(): String {
val result = B().result
if (result != "114433") return "fail: $result"
return "OK"
}
@@ -0,0 +1,11 @@
open class A(val result: String) {
constructor(x: Int, y: Int = 99) : this("$x$y")
}
class B(x: Int) : A(x)
fun box(): String {
val result = B(11).result
if (result != "1199") return "fail: $result"
return "OK"
}