Files
kotlin-fork/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt
T
Dmitry Petrov 0b647ac358 Basic class members generation.
Split testData into 'classes' and 'expressions'.
2016-10-18 09:08:32 +03:00

20 lines
298 B
Kotlin
Vendored

package test
class C
var C?.p: Int
get() = 42
set(value) {}
operator fun Int?.inc(): Int? = this?.inc()
operator fun Int?.get(index: Int): Int = 42
operator fun Int?.set(index: Int, value: Int) {}
fun testProperty(nc: C?) {
nc?.p++
}
fun testArrayAccess(nc: C?) {
nc?.p[0]++
}