KT-52459 Handle context receivers when generating a bridge

This commit is contained in:
Pavel Mikhailovskii
2022-12-27 16:19:59 +00:00
committed by Space Team
parent d735fa6567
commit 3704d54101
4 changed files with 36 additions and 0 deletions
@@ -0,0 +1,23 @@
// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
interface I<T>{
context(A)
fun T.foo(): String
}
class A(val a: String)
class B(val b: String)
object O: I<B>{
context(A)
override fun B.foo(): String = this@A.a + this@B.b
}
fun box(): String {
with(A("O")){
with(O as I<B>){
return B("K").foo()
}
}
}