JS: Remove declarations of unsupported SortedSet and TreeSet, make toSortedSet() jvm-only.
Fix completion test. Relates to #KT-7480
This commit is contained in:
@@ -6,6 +6,5 @@ fun hello() {
|
|||||||
val a = So<caret>
|
val a = So<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
// EXIST: SortedSet
|
|
||||||
// EXIST_JAVA_ONLY: SortedMap
|
// EXIST_JAVA_ONLY: SortedMap
|
||||||
// EXIST_JS_ONLY: JSON
|
// EXIST_JS_ONLY: JSON
|
||||||
|
|||||||
@@ -91,15 +91,6 @@ public open class HashSet<E>(
|
|||||||
override val size: Int get() = noImpl
|
override val size: Int get() = noImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
@library
|
|
||||||
public interface SortedSet<E> : Set<E> {
|
|
||||||
}
|
|
||||||
|
|
||||||
@library
|
|
||||||
public open class TreeSet<E>() : AbstractCollection<E>(), MutableSet<E>, SortedSet<E> {
|
|
||||||
override val size: Int get() = noImpl
|
|
||||||
}
|
|
||||||
|
|
||||||
@library
|
@library
|
||||||
public open class LinkedHashSet<E>(
|
public open class LinkedHashSet<E>(
|
||||||
initialCapacity: Int = DEFAULT_INITIAL_CAPACITY, loadFactor: Float = DEFAULT_LOAD_FACTOR
|
initialCapacity: Int = DEFAULT_INITIAL_CAPACITY, loadFactor: Float = DEFAULT_LOAD_FACTOR
|
||||||
|
|||||||
@@ -6512,6 +6512,7 @@ public fun CharArray.toSet(): Set<Char> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun <T: Comparable<T>> Array<out T>.toSortedSet(): SortedSet<T> {
|
public fun <T: Comparable<T>> Array<out T>.toSortedSet(): SortedSet<T> {
|
||||||
return toCollection(TreeSet<T>())
|
return toCollection(TreeSet<T>())
|
||||||
}
|
}
|
||||||
@@ -6519,6 +6520,7 @@ public fun <T: Comparable<T>> Array<out T>.toSortedSet(): SortedSet<T> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun ByteArray.toSortedSet(): SortedSet<Byte> {
|
public fun ByteArray.toSortedSet(): SortedSet<Byte> {
|
||||||
return toCollection(TreeSet<Byte>())
|
return toCollection(TreeSet<Byte>())
|
||||||
}
|
}
|
||||||
@@ -6526,6 +6528,7 @@ public fun ByteArray.toSortedSet(): SortedSet<Byte> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun ShortArray.toSortedSet(): SortedSet<Short> {
|
public fun ShortArray.toSortedSet(): SortedSet<Short> {
|
||||||
return toCollection(TreeSet<Short>())
|
return toCollection(TreeSet<Short>())
|
||||||
}
|
}
|
||||||
@@ -6533,6 +6536,7 @@ public fun ShortArray.toSortedSet(): SortedSet<Short> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun IntArray.toSortedSet(): SortedSet<Int> {
|
public fun IntArray.toSortedSet(): SortedSet<Int> {
|
||||||
return toCollection(TreeSet<Int>())
|
return toCollection(TreeSet<Int>())
|
||||||
}
|
}
|
||||||
@@ -6540,6 +6544,7 @@ public fun IntArray.toSortedSet(): SortedSet<Int> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun LongArray.toSortedSet(): SortedSet<Long> {
|
public fun LongArray.toSortedSet(): SortedSet<Long> {
|
||||||
return toCollection(TreeSet<Long>())
|
return toCollection(TreeSet<Long>())
|
||||||
}
|
}
|
||||||
@@ -6547,6 +6552,7 @@ public fun LongArray.toSortedSet(): SortedSet<Long> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun FloatArray.toSortedSet(): SortedSet<Float> {
|
public fun FloatArray.toSortedSet(): SortedSet<Float> {
|
||||||
return toCollection(TreeSet<Float>())
|
return toCollection(TreeSet<Float>())
|
||||||
}
|
}
|
||||||
@@ -6554,6 +6560,7 @@ public fun FloatArray.toSortedSet(): SortedSet<Float> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun DoubleArray.toSortedSet(): SortedSet<Double> {
|
public fun DoubleArray.toSortedSet(): SortedSet<Double> {
|
||||||
return toCollection(TreeSet<Double>())
|
return toCollection(TreeSet<Double>())
|
||||||
}
|
}
|
||||||
@@ -6561,6 +6568,7 @@ public fun DoubleArray.toSortedSet(): SortedSet<Double> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun BooleanArray.toSortedSet(): SortedSet<Boolean> {
|
public fun BooleanArray.toSortedSet(): SortedSet<Boolean> {
|
||||||
return toCollection(TreeSet<Boolean>())
|
return toCollection(TreeSet<Boolean>())
|
||||||
}
|
}
|
||||||
@@ -6568,6 +6576,7 @@ public fun BooleanArray.toSortedSet(): SortedSet<Boolean> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun CharArray.toSortedSet(): SortedSet<Char> {
|
public fun CharArray.toSortedSet(): SortedSet<Char> {
|
||||||
return toCollection(TreeSet<Char>())
|
return toCollection(TreeSet<Char>())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1032,6 +1032,7 @@ public fun <T> Iterable<T>.toSet(): Set<T> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun <T: Comparable<T>> Iterable<T>.toSortedSet(): SortedSet<T> {
|
public fun <T: Comparable<T>> Iterable<T>.toSortedSet(): SortedSet<T> {
|
||||||
return toCollection(TreeSet<T>())
|
return toCollection(TreeSet<T>())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -542,6 +542,7 @@ public fun <T> Sequence<T>.toSet(): Set<T> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all elements.
|
* Returns a [SortedSet] of all elements.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun <T: Comparable<T>> Sequence<T>.toSortedSet(): SortedSet<T> {
|
public fun <T: Comparable<T>> Sequence<T>.toSortedSet(): SortedSet<T> {
|
||||||
return toCollection(TreeSet<T>())
|
return toCollection(TreeSet<T>())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -610,6 +610,7 @@ public fun CharSequence.toSet(): Set<Char> {
|
|||||||
/**
|
/**
|
||||||
* Returns a [SortedSet] of all characters.
|
* Returns a [SortedSet] of all characters.
|
||||||
*/
|
*/
|
||||||
|
@kotlin.jvm.JvmVersion
|
||||||
public fun CharSequence.toSortedSet(): SortedSet<Char> {
|
public fun CharSequence.toSortedSet(): SortedSet<Char> {
|
||||||
return toCollection(TreeSet<Char>())
|
return toCollection(TreeSet<Char>())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ fun snapshots(): List<GenericFunction> {
|
|||||||
|
|
||||||
templates add f("toSortedSet()") {
|
templates add f("toSortedSet()") {
|
||||||
include(CharSequences)
|
include(CharSequences)
|
||||||
|
jvmOnly(true)
|
||||||
typeParam("T: Comparable<T>")
|
typeParam("T: Comparable<T>")
|
||||||
doc { f -> "Returns a [SortedSet] of all ${f.element.pluralize()}." }
|
doc { f -> "Returns a [SortedSet] of all ${f.element.pluralize()}." }
|
||||||
returns("SortedSet<T>")
|
returns("SortedSet<T>")
|
||||||
|
|||||||
Reference in New Issue
Block a user