Clarify how elements of arrays are compared by contentEquals function
Add clarification only for the particular group of overloads including arrays of object and floating point numbers. #KT-22942 Fixed
This commit is contained in:
@@ -290,6 +290,9 @@ public fun CharArray.binarySearch(element: Char, fromIndex: Int = 0, toIndex: In
|
||||
*
|
||||
* If two corresponding elements are nested arrays, they are also compared deeply.
|
||||
* If any of arrays contains itself on any nesting level the behavior is undefined.
|
||||
*
|
||||
* The elements of other types are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@JvmName("contentDeepEqualsInline")
|
||||
@@ -339,6 +342,9 @@ public actual inline fun <T> Array<out T>.contentDeepToString(): String {
|
||||
/**
|
||||
* Returns `true` if the two specified arrays are *structurally* equal to one another,
|
||||
* i.e. contain the same number of the same elements in the same order.
|
||||
*
|
||||
* The elements are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@kotlin.internal.InlineOnly
|
||||
@@ -349,6 +355,9 @@ public actual inline infix fun <T> Array<out T>.contentEquals(other: Array<out T
|
||||
/**
|
||||
* Returns `true` if the two specified arrays are *structurally* equal to one another,
|
||||
* i.e. contain the same number of the same elements in the same order.
|
||||
*
|
||||
* The elements are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@kotlin.internal.InlineOnly
|
||||
@@ -359,6 +368,9 @@ public actual inline infix fun ByteArray.contentEquals(other: ByteArray): Boolea
|
||||
/**
|
||||
* Returns `true` if the two specified arrays are *structurally* equal to one another,
|
||||
* i.e. contain the same number of the same elements in the same order.
|
||||
*
|
||||
* The elements are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@kotlin.internal.InlineOnly
|
||||
@@ -369,6 +381,9 @@ public actual inline infix fun ShortArray.contentEquals(other: ShortArray): Bool
|
||||
/**
|
||||
* Returns `true` if the two specified arrays are *structurally* equal to one another,
|
||||
* i.e. contain the same number of the same elements in the same order.
|
||||
*
|
||||
* The elements are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@kotlin.internal.InlineOnly
|
||||
@@ -379,6 +394,9 @@ public actual inline infix fun IntArray.contentEquals(other: IntArray): Boolean
|
||||
/**
|
||||
* Returns `true` if the two specified arrays are *structurally* equal to one another,
|
||||
* i.e. contain the same number of the same elements in the same order.
|
||||
*
|
||||
* The elements are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@kotlin.internal.InlineOnly
|
||||
@@ -389,6 +407,9 @@ public actual inline infix fun LongArray.contentEquals(other: LongArray): Boolea
|
||||
/**
|
||||
* Returns `true` if the two specified arrays are *structurally* equal to one another,
|
||||
* i.e. contain the same number of the same elements in the same order.
|
||||
*
|
||||
* The elements are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@kotlin.internal.InlineOnly
|
||||
@@ -399,6 +420,9 @@ public actual inline infix fun FloatArray.contentEquals(other: FloatArray): Bool
|
||||
/**
|
||||
* Returns `true` if the two specified arrays are *structurally* equal to one another,
|
||||
* i.e. contain the same number of the same elements in the same order.
|
||||
*
|
||||
* The elements are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@kotlin.internal.InlineOnly
|
||||
@@ -409,6 +433,9 @@ public actual inline infix fun DoubleArray.contentEquals(other: DoubleArray): Bo
|
||||
/**
|
||||
* Returns `true` if the two specified arrays are *structurally* equal to one another,
|
||||
* i.e. contain the same number of the same elements in the same order.
|
||||
*
|
||||
* The elements are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@kotlin.internal.InlineOnly
|
||||
@@ -419,6 +446,9 @@ public actual inline infix fun BooleanArray.contentEquals(other: BooleanArray):
|
||||
/**
|
||||
* Returns `true` if the two specified arrays are *structurally* equal to one another,
|
||||
* i.e. contain the same number of the same elements in the same order.
|
||||
*
|
||||
* The elements are compared for equality with the [equals][Any.equals] function.
|
||||
* For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@kotlin.internal.InlineOnly
|
||||
|
||||
Reference in New Issue
Block a user