mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
Type parameters can be referred from value parameters, so we should determine them earlier to be able to set their indexes
24 lines
344 B
Kotlin
Vendored
24 lines
344 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
// KJS_WITH_FULL_RUNTIME
|
|
|
|
import kotlin.collections.HashMap
|
|
|
|
class Inv1<T>
|
|
|
|
class Inv2<K, V>
|
|
|
|
class Something {
|
|
val guilds = Inv2<Int, Inv1<String>>()
|
|
|
|
fun test() {
|
|
guilds[0] = Inv1()
|
|
}
|
|
}
|
|
|
|
operator fun <K, V> Inv2<K, V>.set(key: K, value: V) { }
|
|
|
|
fun box(): String {
|
|
Something().test()
|
|
return "OK"
|
|
}
|