diff --git a/idea/idea-completion/testData/basic/common/FromImports.kt b/idea/idea-completion/testData/basic/common/FromImports.kt index c1d0a18ae53..beaad0a2702 100644 --- a/idea/idea-completion/testData/basic/common/FromImports.kt +++ b/idea/idea-completion/testData/basic/common/FromImports.kt @@ -6,6 +6,5 @@ fun hello() { val a = So } -// EXIST: SortedSet // EXIST_JAVA_ONLY: SortedMap // EXIST_JS_ONLY: JSON diff --git a/js/js.libraries/src/core/javautil.kt b/js/js.libraries/src/core/javautil.kt index b8b7b2fc054..e54fe82d312 100644 --- a/js/js.libraries/src/core/javautil.kt +++ b/js/js.libraries/src/core/javautil.kt @@ -91,15 +91,6 @@ public open class HashSet( override val size: Int get() = noImpl } -@library -public interface SortedSet : Set { -} - -@library -public open class TreeSet() : AbstractCollection(), MutableSet, SortedSet { - override val size: Int get() = noImpl -} - @library public open class LinkedHashSet( initialCapacity: Int = DEFAULT_INITIAL_CAPACITY, loadFactor: Float = DEFAULT_LOAD_FACTOR diff --git a/libraries/stdlib/src/generated/_Arrays.kt b/libraries/stdlib/src/generated/_Arrays.kt index be082fb19b2..f00fda05d51 100644 --- a/libraries/stdlib/src/generated/_Arrays.kt +++ b/libraries/stdlib/src/generated/_Arrays.kt @@ -6512,6 +6512,7 @@ public fun CharArray.toSet(): Set { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun > Array.toSortedSet(): SortedSet { return toCollection(TreeSet()) } @@ -6519,6 +6520,7 @@ public fun > Array.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun ByteArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } @@ -6526,6 +6528,7 @@ public fun ByteArray.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun ShortArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } @@ -6533,6 +6536,7 @@ public fun ShortArray.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun IntArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } @@ -6540,6 +6544,7 @@ public fun IntArray.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun LongArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } @@ -6547,6 +6552,7 @@ public fun LongArray.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun FloatArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } @@ -6554,6 +6560,7 @@ public fun FloatArray.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun DoubleArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } @@ -6561,6 +6568,7 @@ public fun DoubleArray.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun BooleanArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } @@ -6568,6 +6576,7 @@ public fun BooleanArray.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun CharArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } diff --git a/libraries/stdlib/src/generated/_Collections.kt b/libraries/stdlib/src/generated/_Collections.kt index e5129bcc22c..3267c6211f1 100644 --- a/libraries/stdlib/src/generated/_Collections.kt +++ b/libraries/stdlib/src/generated/_Collections.kt @@ -1032,6 +1032,7 @@ public fun Iterable.toSet(): Set { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun > Iterable.toSortedSet(): SortedSet { return toCollection(TreeSet()) } diff --git a/libraries/stdlib/src/generated/_Sequences.kt b/libraries/stdlib/src/generated/_Sequences.kt index b8d958e931c..1fc51c0c1f2 100644 --- a/libraries/stdlib/src/generated/_Sequences.kt +++ b/libraries/stdlib/src/generated/_Sequences.kt @@ -542,6 +542,7 @@ public fun Sequence.toSet(): Set { /** * Returns a [SortedSet] of all elements. */ +@kotlin.jvm.JvmVersion public fun > Sequence.toSortedSet(): SortedSet { return toCollection(TreeSet()) } diff --git a/libraries/stdlib/src/generated/_Strings.kt b/libraries/stdlib/src/generated/_Strings.kt index d1919f449d1..cb66cad73a4 100644 --- a/libraries/stdlib/src/generated/_Strings.kt +++ b/libraries/stdlib/src/generated/_Strings.kt @@ -610,6 +610,7 @@ public fun CharSequence.toSet(): Set { /** * Returns a [SortedSet] of all characters. */ +@kotlin.jvm.JvmVersion public fun CharSequence.toSortedSet(): SortedSet { return toCollection(TreeSet()) } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt index bc01a6f23b2..a11907cb7e1 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt @@ -40,6 +40,7 @@ fun snapshots(): List { templates add f("toSortedSet()") { include(CharSequences) + jvmOnly(true) typeParam("T: Comparable") doc { f -> "Returns a [SortedSet] of all ${f.element.pluralize()}." } returns("SortedSet")