Fix fun interfaces with extension receivers

#KT-37712 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-04-27 04:57:55 +03:00
parent fa50d66afe
commit 780bc1f607
9 changed files with 61 additions and 4 deletions
@@ -0,0 +1,24 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
fun interface FunWithReceiver {
fun String.foo(): String
}
val prop = FunWithReceiver { this }
fun bar(s: String, f: FunWithReceiver): String {
return with(f) {
s.foo()
}
}
fun box(): String {
val r1 = with(prop) {
"OK".foo()
}
if (r1 != "OK") return "failed 1"
return bar("O") { this + "K" }
}