Files
kotlin-fork/compiler/testData/ir/irText/expressions/objectReference.kt
T
2023-07-19 10:39:41 +00:00

70 lines
1.0 KiB
Kotlin
Vendored

// FIR_IDENTICAL
object Z {
var counter = 0
fun foo() {}
fun bar() {
counter = 1
foo()
Z.counter = 1
Z.foo()
}
class Nested {
init {
counter = 1
foo()
Z.counter = 1
Z.foo()
}
fun test() {
counter = 1
foo()
Z.counter = 1
Z.foo()
}
}
fun aFun() {
withLambda {
counter = 1
foo()
Z.counter = 1
Z.foo()
}
}
val aLambda = {
counter = 1
foo()
Z.counter = 1
Z.foo()
}
val anObject = object {
init {
counter = 1
foo()
Z.counter = 1
Z.foo()
}
fun test() {
counter = 1
foo()
Z.counter = 1
Z.foo()
}
}
}
fun Z.test() {
counter = 1
foo()
Z.counter = 1
Z.foo()
}
fun withLambda(f: () -> Unit) {}