KT-12707: support case when secondary super constructor has optional parameters
This commit is contained in:
+11
@@ -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"
|
||||
}
|
||||
+11
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user