Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/kt38337.kt
T
2021-12-15 17:14:22 +00:00

14 lines
338 B
Kotlin
Vendored

// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
OPTIONAL_JVM_INLINE_ANNOTATION
value class Wrapper(val id: Int)
class DMap(private val map: Map<Wrapper, String>) :
Map<Wrapper, String> by map
fun box(): String {
val dmap = DMap(mutableMapOf(Wrapper(42) to "OK"))
return dmap[Wrapper(42)] ?: "Fail"
}