Annotate all new API with SinceKotlin in kotlin-stdlib and kotlin-test
This commit is contained in:
@@ -88,6 +88,7 @@ fun <@OnlyInputTypes T> expect(expected: T, message: String?, block: () -> T) {
|
|||||||
fun assertFails(block: () -> Unit): Throwable = assertFails(null, block)
|
fun assertFails(block: () -> Unit): Throwable = assertFails(null, block)
|
||||||
|
|
||||||
/** Asserts that given function [block] fails by throwing an exception. */
|
/** Asserts that given function [block] fails by throwing an exception. */
|
||||||
|
@SinceKotlin("1.1")
|
||||||
fun assertFails(message: String?, block: () -> Unit): Throwable {
|
fun assertFails(message: String?, block: () -> Unit): Throwable {
|
||||||
try {
|
try {
|
||||||
block()
|
block()
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package kotlin.collections
|
package kotlin.collections
|
||||||
|
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public abstract class AbstractCollection<out E> protected constructor() : Collection<E> {
|
public abstract class AbstractCollection<out E> protected constructor() : Collection<E> {
|
||||||
abstract override val size: Int
|
abstract override val size: Int
|
||||||
abstract override fun iterator(): Iterator<E>
|
abstract override fun iterator(): Iterator<E>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
package kotlin.collections
|
package kotlin.collections
|
||||||
|
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public abstract class AbstractList<out E> protected constructor() : AbstractCollection<E>(), List<E> {
|
public abstract class AbstractList<out E> protected constructor() : AbstractCollection<E>(), List<E> {
|
||||||
abstract override val size: Int
|
abstract override val size: Int
|
||||||
abstract override fun get(index: Int): E
|
abstract override fun get(index: Int): E
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
package kotlin.collections
|
package kotlin.collections
|
||||||
|
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public abstract class AbstractMap<K, out V> protected constructor() : Map<K, V> {
|
public abstract class AbstractMap<K, out V> protected constructor() : Map<K, V> {
|
||||||
|
|
||||||
override fun containsKey(key: K): Boolean {
|
override fun containsKey(key: K): Boolean {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package kotlin.collections
|
|||||||
|
|
||||||
import java.util.AbstractCollection
|
import java.util.AbstractCollection
|
||||||
|
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public abstract class AbstractMutableCollection<E> protected constructor() : AbstractCollection<E>() {
|
public abstract class AbstractMutableCollection<E> protected constructor() : AbstractCollection<E>() {
|
||||||
abstract override fun add(element: E): Boolean
|
abstract override fun add(element: E): Boolean
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ package kotlin.collections
|
|||||||
|
|
||||||
import java.util.AbstractList
|
import java.util.AbstractList
|
||||||
|
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public abstract class AbstractMutableList<E> protected constructor() : AbstractList<E>() {
|
public abstract class AbstractMutableList<E> protected constructor() : AbstractList<E>() {
|
||||||
abstract override fun set(index: Int, element: E): E
|
abstract override fun set(index: Int, element: E): E
|
||||||
abstract override fun removeAt(index: Int): E
|
abstract override fun removeAt(index: Int): E
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package kotlin.collections
|
|||||||
|
|
||||||
import java.util.AbstractMap
|
import java.util.AbstractMap
|
||||||
|
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public abstract class AbstractMutableMap<K, V> protected constructor() : AbstractMap<K, V>() {
|
public abstract class AbstractMutableMap<K, V> protected constructor() : AbstractMap<K, V>() {
|
||||||
abstract override fun put(key: K, value: V): V?
|
abstract override fun put(key: K, value: V): V?
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ package kotlin.collections
|
|||||||
|
|
||||||
import java.util.AbstractSet
|
import java.util.AbstractSet
|
||||||
|
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public abstract class AbstractMutableSet<E> protected constructor() : AbstractSet<E>() {
|
public abstract class AbstractMutableSet<E> protected constructor() : AbstractSet<E>() {
|
||||||
// nothing to make abstract, maybe leave it typealias then?
|
// nothing to make abstract, maybe leave it typealias then?
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package kotlin.collections
|
package kotlin.collections
|
||||||
|
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public abstract class AbstractSet<out E> protected constructor() : AbstractCollection<E>(), Set<E> {
|
public abstract class AbstractSet<out E> protected constructor() : AbstractCollection<E>(), Set<E> {
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
|
|||||||
@@ -445,6 +445,7 @@ public fun <K, V, M : MutableMap<in K, in V>> Sequence<Pair<K, V>>.toMap(destina
|
|||||||
*
|
*
|
||||||
* The returned map preserves the entry iteration order of the original map.
|
* The returned map preserves the entry iteration order of the original map.
|
||||||
*/
|
*/
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public fun <K, V> Map<out K, V>.toMap(): Map<K, V> = when (size) {
|
public fun <K, V> Map<out K, V>.toMap(): Map<K, V> = when (size) {
|
||||||
0 -> emptyMap()
|
0 -> emptyMap()
|
||||||
1 -> toSingletonMap()
|
1 -> toSingletonMap()
|
||||||
@@ -456,11 +457,13 @@ public fun <K, V> Map<out K, V>.toMap(): Map<K, V> = when (size) {
|
|||||||
*
|
*
|
||||||
* The returned map preserves the entry iteration order of the original map.
|
* The returned map preserves the entry iteration order of the original map.
|
||||||
*/
|
*/
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public fun <K, V> Map<out K, V>.toMutableMap(): MutableMap<K, V> = LinkedHashMap(this)
|
public fun <K, V> Map<out K, V>.toMutableMap(): MutableMap<K, V> = LinkedHashMap(this)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Populates and returns the [destination] mutable map with key-value pairs from the given map.
|
* Populates and returns the [destination] mutable map with key-value pairs from the given map.
|
||||||
*/
|
*/
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public fun <K, V, M : MutableMap<in K, in V>> Map<out K, V>.toMap(destination: M): M
|
public fun <K, V, M : MutableMap<in K, in V>> Map<out K, V>.toMap(destination: M): M
|
||||||
= destination.apply { putAll(this@toMap) }
|
= destination.apply { putAll(this@toMap) }
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ internal open class PlatformImplementations {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SinceKotlin("1.1")
|
||||||
@kotlin.internal.InlineExposed
|
@kotlin.internal.InlineExposed
|
||||||
internal fun platformCloseSuppressed(instance: Closeable, cause: Throwable) = IMPLEMENTATIONS.closeSuppressed(instance, cause)
|
internal fun platformCloseSuppressed(instance: Closeable, cause: Throwable) = IMPLEMENTATIONS.closeSuppressed(instance, cause)
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public inline fun buildString(builderAction: StringBuilder.() -> Unit): String =
|
|||||||
* Builds new string by populating newly created [StringBuilder] initialized with the given [capacity]
|
* Builds new string by populating newly created [StringBuilder] initialized with the given [capacity]
|
||||||
* using provided [builderAction] and then converting it to [String].
|
* using provided [builderAction] and then converting it to [String].
|
||||||
*/
|
*/
|
||||||
|
@SinceKotlin("1.1")
|
||||||
@kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun buildString(capacity: Int, builderAction: StringBuilder.() -> Unit): String =
|
public inline fun buildString(capacity: Int, builderAction: StringBuilder.() -> Unit): String =
|
||||||
StringBuilder(capacity).apply(builderAction).toString()
|
StringBuilder(capacity).apply(builderAction).toString()
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public interface MatchGroupCollection : Collection<MatchGroup?> {
|
|||||||
/**
|
/**
|
||||||
* Extends [MatchGroupCollection] by introducing a way to get matched groups by name, when regex supports it.
|
* Extends [MatchGroupCollection] by introducing a way to get matched groups by name, when regex supports it.
|
||||||
*/
|
*/
|
||||||
|
@SinceKotlin("1.1")
|
||||||
public interface MatchNamedGroupCollection : MatchGroupCollection {
|
public interface MatchNamedGroupCollection : MatchGroupCollection {
|
||||||
/**
|
/**
|
||||||
* Returns a named group with the specified [name].
|
* Returns a named group with the specified [name].
|
||||||
|
|||||||
Reference in New Issue
Block a user