Files
kotlin-fork/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt
T
2022-12-14 21:46:41 +00:00

24 lines
377 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
interface Canvas {
val suffix: String
}
interface Shape {
context(Canvas)
fun draw(): String
}
class Circle : Shape {
context(Canvas)
override fun draw() = "OK" + suffix
}
object MyCanvas : Canvas {
override val suffix = ""
}
fun box() = with(MyCanvas) { Circle().draw() }