Fix default argument method calls
In some cases, calls of methods with default arguments were invoked via the actual generated method, not via the "...$default" accessor
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
var result = "Fail"
|
||||
|
||||
class A
|
||||
|
||||
fun A.plusAssign(a: A, s: String = "OK") {
|
||||
result = s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
A() += A()
|
||||
return result
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
var result = "Fail"
|
||||
|
||||
class A
|
||||
|
||||
fun A.plus(a: A, s: String = "OK"): A {
|
||||
result = s
|
||||
return this
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var a = A()
|
||||
a += A()
|
||||
return result
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun Int.foo(o: String, k: String = "K") = o + k
|
||||
|
||||
fun box() = 42 foo "O"
|
||||
@@ -0,0 +1,5 @@
|
||||
class A
|
||||
|
||||
fun A.plus(i: A, ok: String = "OK") = ok
|
||||
|
||||
fun box() = A() + A()
|
||||
@@ -0,0 +1,5 @@
|
||||
class A
|
||||
|
||||
fun A.contains(i: A, actual: Boolean = true) = actual
|
||||
|
||||
fun box() = if (A() in A()) "OK" else "Fail"
|
||||
Reference in New Issue
Block a user