Files
kotlin-fork/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.kt.txt
T
Dmitriy Novozhilov b454fcc1e0 [FIR] Save IR dumps to .ir.txt files instead of .txt in tests
This is needed to avoid clashes between different dumps from different
  handlers
2021-10-12 17:26:36 +03:00

40 lines
793 B
Plaintext
Vendored

object Host {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
class StringDelegate {
constructor(s: String) /* primary */ {
super/*Any*/()
/* <init>() */
}
val s: String
field = s
get
operator fun getValue(receiver: String, p: Any): String {
return receiver.plus(other = <this>.<get-s>())
}
}
operator fun String.provideDelegate(host: Any?, p: Any): StringDelegate {
return StringDelegate(s = <this>)
}
val String.plusK: String /* by */
field = (<this>, "K").provideDelegate(host = <this>, p = Host::plusK)
get(): String {
return <this>.#plusK$delegate.getValue(receiver = <this>, p = Host::plusK)
}
val ok: String
field = (<this>, "O").<get-plusK>()
get
}