Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/kt38337Generic.kt
T
2023-12-26 10:18:19 +00:00

15 lines
426 B
Kotlin
Vendored

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