mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 08:31:38 +00:00
Move collectionStubMethodLowering before jvmInlineClassPhase, and make them interact properly. Note that some issues still remain in inline class <-> special bridges interaction. KT-40187 KT-42469
21 lines
923 B
Kotlin
Vendored
21 lines
923 B
Kotlin
Vendored
// IGNORE_ANNOTATIONS
|
|
|
|
inline class IK(val x: Int)
|
|
inline class IV(val x: Double)
|
|
|
|
inline class InlineMutableMap(private val mmap: MutableMap<IK, IV>) : MutableMap<IK, IV> {
|
|
override val size: Int get() = mmap.size
|
|
override fun containsKey(key: IK): Boolean = mmap.containsKey(key)
|
|
override fun containsValue(value: IV): Boolean = mmap.containsValue(value)
|
|
override fun get(key: IK): IV? = mmap[key]
|
|
override fun isEmpty(): Boolean = mmap.isEmpty()
|
|
override val entries: MutableSet<MutableMap.MutableEntry<IK, IV>> get() = mmap.entries
|
|
override val keys: MutableSet<IK> get() = mmap.keys
|
|
override val values: MutableCollection<IV> get() = mmap.values
|
|
override fun clear() { mmap.clear() }
|
|
override fun put(key: IK, value: IV): IV? = mmap.put(key, value)
|
|
override fun putAll(from: Map<out IK, IV>) { mmap.putAll(from) }
|
|
override fun remove(key: IK): IV? = mmap.remove(key)
|
|
}
|
|
|