Files
kotlin-fork/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt
T
Anastasiya Shadrina 3f50b675b1 [Tests] Add irText tests
2021-12-02 20:24:25 +03:00

44 lines
696 B
Plaintext
Vendored

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