diff --git a/runtime/src/main/kotlin/konan/Annotations.kt b/runtime/src/main/kotlin/konan/Annotations.kt index 4ff0173ecb6..dbd0712ed4f 100644 --- a/runtime/src/main/kotlin/konan/Annotations.kt +++ b/runtime/src/main/kotlin/konan/Annotations.kt @@ -26,21 +26,11 @@ public annotation class Used // Following annotations can be used to mark functions that need to be fixed, // once certain language feature is implemented. -/** - * Need to be fixed because of boxing. - */ -public annotation class FixmeBoxing - /** * Need to be fixed because of inner classes. */ public annotation class FixmeInner -/** - * Need to be fixed because of lambdas. - */ -public annotation class FixmeLambda - /** * Need to be fixed. */ diff --git a/runtime/src/main/kotlin/kotlin/collections/Maps.kt b/runtime/src/main/kotlin/kotlin/collections/Maps.kt index 53a521efb7a..20272206cc3 100644 --- a/runtime/src/main/kotlin/kotlin/collections/Maps.kt +++ b/runtime/src/main/kotlin/kotlin/collections/Maps.kt @@ -59,9 +59,8 @@ public inline fun mapOf(): Map = emptyMap() * @sample samples.collections.Maps.Instantiation.mutableMapFromPairs * @sample samples.collections.Maps.Instantiation.emptyMutableMap */ -@Fixme -public fun mutableMapOf(vararg pairs: Pair): MutableMap = hashMapOf(*pairs) -// = HashMap(mapCapacity(pairs.size)).apply { putAll(pairs) } +public fun mutableMapOf(vararg pairs: Pair): MutableMap + = HashMap(mapCapacity(pairs.size)).apply { putAll(pairs) } /** * Returns a new [HashMap] with the specified contents, given as a list of pairs @@ -69,13 +68,8 @@ public fun mutableMapOf(vararg pairs: Pair): MutableMap = has * * @sample samples.collections.Maps.Instantiation.hashMapFromPairs */ -public fun hashMapOf(vararg pairs: Pair): HashMap { -// = HashMap(mapCapacity(pairs.size)).apply { putAll(pairs) } - val result = HashMap(mapCapacity(pairs.size)) - for (pair in pairs) - result.put(pair.first, pair.second) - return result -} +public fun hashMapOf(vararg pairs: Pair): HashMap + = HashMap(mapCapacity(pairs.size)).apply { putAll(pairs) } /** * Returns a new [HashMap] with the specified contents, given as a list of pairs @@ -649,11 +643,9 @@ public inline fun Map.mapNotNull(transform: (Map.Entry * Applies the given [transform] function to each entry in the original map * and appends only the non-null results to the given [destination]. */ -@FixmeLambda public inline fun > Map.mapNotNullTo(destination: C, transform: (Map.Entry) -> R?): C { - TODO() - //forEach { element -> transform(element)?.let { destination.add(it) } } - //return destination + forEach { element -> transform(element)?.let { destination.add(it) } } + return destination } /** diff --git a/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt b/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt index 9ec6fbe9f18..1713e0e769b 100644 --- a/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt +++ b/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt @@ -149,20 +149,16 @@ public fun MutableIterable.removeAll(predicate: (T) -> Boolean): Boolean */ public fun MutableIterable.retainAll(predicate: (T) -> Boolean): Boolean = filterInPlace(predicate, false) -// TODO: due to boxing problems, cannot use Boolean type. -@FixmeBoxing private fun MutableIterable.filterInPlace(predicate: (T) -> Boolean, predicateResultToRemove: Boolean): Boolean { - TODO() - /* var result = false with (iterator()) { while (hasNext()) - if (predicate(next()).toString() == predicateResultToRemove) { + if (predicate(next()) == predicateResultToRemove) { remove() result = true } } - return result */ + return result } /**