mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 15:53:49 +00:00
13 lines
421 B
Kotlin
Vendored
13 lines
421 B
Kotlin
Vendored
/**
|
|
These declarations are "shallow" in the sense that they are not really compiled, only the type-checker uses them
|
|
*/
|
|
|
|
open class ReadOnlyArray<out T> : ISized {
|
|
@[operator] fun get(index : Int) : T
|
|
}
|
|
|
|
open class WriteOnlyArray<in T> : ISized { // This is needed to keep IIterator's <T> covariant
|
|
@[operator] fun set(index : Int, value : T)
|
|
}
|
|
|
|
class MutableArray<T> : ReadOnlyArray<T>, WriteOnlyArray<T> {/*...*/} |