Files
Yan Zhulanow 030dbac1b8 [kotlin] Use WITH_STDLIB directive in tests appeared in Kotlin 1.6.20
GitOrigin-RevId: 940c98e403dc9691d4b92de06f48e175d2ee73b1
2022-02-08 08:52:47 +00:00

21 lines
336 B
Kotlin

// PROBLEM: none
// WITH_STDLIB
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
@RequiresOptIn
annotation class Marker
class Foo() {
val bar = Array<Int>(5) { 0 }
@Marker
operator fun set(index: Int, value: Int) {
bar[index] = value
}
}
@OptIn(<caret>Marker::class)
fun baz(foo: Foo) {
foo[2] = 1
}