KT-2270 VerifyError when default value of constructor parameter is previous parameter
#KT-2270 Fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
trait A {
|
||||
fun foo(x: Int, y: Int = x + 20, z: Int = y * 2) = z
|
||||
}
|
||||
|
||||
class B : A {}
|
||||
|
||||
fun box() = if (B().foo(1) == 42) "OK" else "Fail"
|
||||
@@ -0,0 +1,5 @@
|
||||
class A(val expected: Int) {
|
||||
fun foo(x: Int, y: Int = x + 20, z: Int = y * 2) = z == expected
|
||||
}
|
||||
|
||||
fun box() = if (A(42).foo(1)) "OK" else "Fail"
|
||||
@@ -0,0 +1,6 @@
|
||||
class A(
|
||||
val i : Int,
|
||||
val j : Int = i
|
||||
)
|
||||
|
||||
fun box() = if (A(1).j == 1) "OK" else "fail"
|
||||
Reference in New Issue
Block a user