@@ -44,26 +44,26 @@ public fun <V> emptyIDMap(): IDMaps<V> = EmptyIDMap as IDMaps<V>
44
44
45
45
public fun <V > idMapOf (): IDMaps <V > = emptyIDMap()
46
46
47
- public fun <V > idMapOf (vararg pairs : Pair <ID , V >): IDMaps <V > =
47
+ public fun <V : Any > idMapOf (vararg pairs : Pair <ID , V >): IDMaps <V > =
48
48
when {
49
49
pairs.isEmpty() -> emptyIDMap()
50
50
pairs.size == 1 -> SignalPairIDMap (pairs[0 ].first, pairs[0 ].second)
51
51
else -> CharSequenceIDMap (pairs.toMap(mutableMapOf ()))
52
52
}
53
53
54
- public fun <V > idMapOf (map : Map <ID , V >): IDMaps <V > =
54
+ public fun <V : Any > idMapOf (map : Map <ID , V >): IDMaps <V > =
55
55
when {
56
56
map.isEmpty() -> emptyIDMap()
57
57
map.size == 1 -> map.entries.first().let { SignalPairIDMap (it.key, it.value) }
58
58
else -> CharSequenceIDMap (map.toMutableMap())
59
59
}
60
60
61
61
62
- public fun <V > mutableIDMapOf (): MutableIDMaps <V > = CharSequenceIDMap (mutableMapOf ())
62
+ public fun <V : Any > mutableIDMapOf (): MutableIDMaps <V > = CharSequenceIDMap (mutableMapOf ())
63
63
64
- public fun <V > mutableIDMapOf (vararg pairs : Pair <ID , V >): MutableIDMaps <V > = CharSequenceIDMap (pairs.toMap(mutableMapOf ()))
64
+ public fun <V : Any > mutableIDMapOf (vararg pairs : Pair <ID , V >): MutableIDMaps <V > = CharSequenceIDMap (pairs.toMap(mutableMapOf ()))
65
65
66
- public fun <V > mutableIDMapOf (map : Map <ID , V >): MutableIDMaps <V > = CharSequenceIDMap (map.toMutableMap())
66
+ public fun <V : Any > mutableIDMapOf (map : Map <ID , V >): MutableIDMaps <V > = CharSequenceIDMap (map.toMutableMap())
67
67
68
68
69
69
/* *
@@ -112,7 +112,7 @@ private class SignalPairIDMap<V>(val id: ID, val value: V) : IDMaps<V> {
112
112
}
113
113
114
114
115
- private class CharSequenceIDMap <V >(private val delegate : MutableMap <ID , V >) : MutableIDMaps<V> {
115
+ private class CharSequenceIDMap <V : Any >(private val delegate : MutableMap <ID , V >) : MutableIDMaps<V> {
116
116
override val entries: MutableSet <MutableMap .MutableEntry <ID , V >>
117
117
get() = delegate.entries.toMutableSet()
118
118
@@ -177,7 +177,6 @@ private class CharSequenceIDMap<V>(private val delegate: MutableMap<ID, V>) : Mu
177
177
return delegate.computeIfAbsent(key, mappingFunction)
178
178
}
179
179
180
- @Suppress(" WRONG_TYPE_PARAMETER_NULLABILITY_FOR_JAVA_OVERRIDE" )
181
180
override fun computeIfPresent (key : ID , remappingFunction : BiFunction <in ID , in V , out V ?>): V ? {
182
181
return delegate.computeIfPresent(key, remappingFunction)
183
182
}
0 commit comments