IR: work around a bug in interface delegation descriptors
interface I {
fun f(x: Int = 1)
}
class C(val y: I) : I by y {
// implicit `override fun f(x: Int) = y.f(x)` has a default value for `x`
}
-- the only case where a function with overridden symbols has defaults.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// FILE: A.kt
|
||||
package lib
|
||||
|
||||
interface A {
|
||||
fun f(x: String = "OK"): String
|
||||
}
|
||||
|
||||
class B : A {
|
||||
override fun f(x: String) = x
|
||||
}
|
||||
|
||||
class C(val x: A) : A by x
|
||||
|
||||
// FILE: B.kt
|
||||
import lib.*
|
||||
|
||||
fun box() = C(B()).f()
|
||||
Reference in New Issue
Block a user