KT-52459 Handle context receivers when generating a bridge
This commit is contained in:
committed by
Space Team
parent
d735fa6567
commit
3704d54101
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user