Files
kotlin-fork/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt
T
2024-02-16 10:19:38 +00:00

45 lines
749 B
Kotlin
Vendored

class Circle : Shape {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
override fun draw($context_receiver_0: Canvas): String {
return "OK".plus(other = $context_receiver_0.<get-suffix>())
}
}
interface Canvas {
abstract val suffix: String
abstract get
}
interface Shape {
abstract fun draw($context_receiver_0: Canvas): String
}
object MyCanvas : Canvas {
override val suffix: String
field = ""
override get
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
fun box(): String {
return with<MyCanvas, String>(receiver = MyCanvas, block = local fun MyCanvas.<anonymous>(): String {
return Circle().draw($context_receiver_0 = $this$with)
}
)
}