From e00cdfc8e1f7840613709d69504ef80cbfe51c23 Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Tue, 17 Feb 2015 20:41:10 +0300 Subject: [PATCH] toSortedMap() without a comparator requires keys that are Comparable. --- libraries/stdlib/src/kotlin/collections/MapsJVM.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/stdlib/src/kotlin/collections/MapsJVM.kt b/libraries/stdlib/src/kotlin/collections/MapsJVM.kt index 3432ecd03de..5fe02ce10ed 100644 --- a/libraries/stdlib/src/kotlin/collections/MapsJVM.kt +++ b/libraries/stdlib/src/kotlin/collections/MapsJVM.kt @@ -17,7 +17,7 @@ public fun MutableMap.set(key: K, value: V): V? = put(key, value) * * @sample test.collections.MapJVMTest.toSortedMap */ -public fun Map.toSortedMap(): SortedMap = TreeMap(this) +public fun , V> Map.toSortedMap(): SortedMap = TreeMap(this) /** * Converts this [Map] to a [SortedMap] using the given [comparator] so that iteration order will be in the order