Files
kotlin-fork/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.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

class Delegate {
constructor(value: String) /* primary */ {
super/*Any*/()
/* <init>() */
}
val value: String
field = value
get
operator fun getValue(thisRef: Any?, property: Any?): String {
return <this>.<get-value>()
}
}
class DelegateProvider {
constructor(value: String) /* primary */ {
super/*Any*/()
/* <init>() */
}
val value: String
field = value
get
operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate {
return Delegate(value = <this>.<get-value>())
}
}
val testTopLevel: String /* by */
field = DelegateProvider(value = "OK").provideDelegate(thisRef = null, property = ::testTopLevel)
get(): String {
return #testTopLevel$delegate.getValue(thisRef = null, property = ::testTopLevel)
}