Suppress code warnings in kotlin-stdlib

This commit is contained in:
Alexander Udalov
2020-08-13 19:13:31 +02:00
parent 5ef4f7df5a
commit da6d904c6e
32 changed files with 62 additions and 18 deletions
+1 -1
View File
@@ -328,7 +328,7 @@ public interface Map<K, out V> {
@PlatformDependent @PlatformDependent
public fun getOrDefault(key: K, defaultValue: @UnsafeVariance V): V { public fun getOrDefault(key: K, defaultValue: @UnsafeVariance V): V {
// See default implementation in JDK sources // See default implementation in JDK sources
return null as V throw NotImplementedError()
} }
// Views // Views
@@ -138,6 +138,7 @@ public expect fun Throwable.stackTraceToString(): String
* Prints the [detailed description][Throwable.stackTraceToString] of this throwable to the standard output or standard error output. * Prints the [detailed description][Throwable.stackTraceToString] of this throwable to the standard output or standard error output.
*/ */
@SinceKotlin("1.4") @SinceKotlin("1.4")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
public expect fun Throwable.printStackTrace(): Unit public expect fun Throwable.printStackTrace(): Unit
/** /**
+1 -1
View File
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("NON_ABSTRACT_FUNCTION_WITH_NO_BODY") @file:Suppress("NON_ABSTRACT_FUNCTION_WITH_NO_BODY", "UNUSED_PARAMETER")
package kotlin package kotlin
+1
View File
@@ -53,6 +53,7 @@ public class Char internal constructor(private val value: Int) : Comparable<Char
public fun toDouble(): Double = value.toDouble() public fun toDouble(): Double = value.toDouble()
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
@Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
if (other === this) return true if (other === this) return true
if (other !is Char) return false if (other !is Char) return false
@@ -3,6 +3,8 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("NOTHING_TO_INLINE")
package kotlin package kotlin
import kotlin.internal.PureReifiable import kotlin.internal.PureReifiable
@@ -676,6 +676,7 @@ public class Int private constructor() : Number(), Comparable<Int> {
* On the JVM, non-nullable values of this type are represented as values of the primitive type `float`. * On the JVM, non-nullable values of this type are represented as values of the primitive type `float`.
*/ */
public class Float private constructor() : Number(), Comparable<Float> { public class Float private constructor() : Number(), Comparable<Float> {
@Suppress("DIVISION_BY_ZERO")
companion object { companion object {
/** /**
* A constant holding the smallest *positive* nonzero value of Float. * A constant holding the smallest *positive* nonzero value of Float.
@@ -893,6 +894,7 @@ public class Float private constructor() : Number(), Comparable<Float> {
* On the JVM, non-nullable values of this type are represented as values of the primitive type `double`. * On the JVM, non-nullable values of this type are represented as values of the primitive type `double`.
*/ */
public class Double private constructor() : Number(), Comparable<Double> { public class Double private constructor() : Number(), Comparable<Double> {
@Suppress("DIVISION_BY_ZERO")
companion object { companion object {
/** /**
* A constant holding the smallest *positive* nonzero value of Double. * A constant holding the smallest *positive* nonzero value of Double.
+1 -1
View File
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("NON_ABSTRACT_FUNCTION_WITH_NO_BODY", "MUST_BE_INITIALIZED_OR_BE_ABSTRACT") @file:Suppress("NON_ABSTRACT_FUNCTION_WITH_NO_BODY", "MUST_BE_INITIALIZED_OR_BE_ABSTRACT", "UNUSED_PARAMETER")
package kotlin package kotlin
@@ -53,6 +53,7 @@ internal fun doubleSignBit(value: Double): Int {
} }
internal fun getNumberHashCode(obj: Double): Int { internal fun getNumberHashCode(obj: Double): Int {
@Suppress("DEPRECATED_IDENTITY_EQUALS")
if (jsBitwiseOr(obj, 0).unsafeCast<Double>() === obj) { if (jsBitwiseOr(obj, 0).unsafeCast<Double>() === obj) {
return obj.toInt() return obj.toInt()
} }
@@ -117,5 +117,5 @@ internal external class JsObject {
} }
} }
internal fun <T, R> boxIntrinsic(x: T): R = error("Should be lowered") internal fun <T, R> boxIntrinsic(@Suppress("UNUSED_PARAMETER") x: T): R = error("Should be lowered")
internal fun <T, R> unboxIntrinsic(x: T): R = error("Should be lowered") internal fun <T, R> unboxIntrinsic(@Suppress("UNUSED_PARAMETER") x: T): R = error("Should be lowered")
@@ -10,5 +10,5 @@ internal fun <T : Enum<T>> enumValuesIntrinsic(): Array<T> =
throw IllegalStateException("Should be replaced by compiler") throw IllegalStateException("Should be replaced by compiler")
@PublishedApi @PublishedApi
internal fun <T : Enum<T>> enumValueOfIntrinsic(name: String): T = internal fun <T : Enum<T>> enumValueOfIntrinsic(@Suppress("UNUSED_PARAMETER") name: String): T =
throw IllegalStateException("Should be replaced by compiler") throw IllegalStateException("Should be replaced by compiler")
+2
View File
@@ -3,6 +3,8 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("NOTHING_TO_INLINE")
package kotlin package kotlin
/** /**
+3
View File
@@ -286,6 +286,7 @@ internal fun Long.divide(other: Long): Long {
internal fun Long.modulo(other: Long) = subtract(div(other).multiply(other)) internal fun Long.modulo(other: Long) = subtract(div(other).multiply(other))
internal fun Long.shiftLeft(numBits: Int): Long { internal fun Long.shiftLeft(numBits: Int): Long {
@Suppress("NAME_SHADOWING")
val numBits = numBits and 63 val numBits = numBits and 63
if (numBits == 0) { if (numBits == 0) {
return this return this
@@ -299,6 +300,7 @@ internal fun Long.shiftLeft(numBits: Int): Long {
} }
internal fun Long.shiftRight(numBits: Int): Long { internal fun Long.shiftRight(numBits: Int): Long {
@Suppress("NAME_SHADOWING")
val numBits = numBits and 63 val numBits = numBits and 63
if (numBits == 0) { if (numBits == 0) {
return this return this
@@ -312,6 +314,7 @@ internal fun Long.shiftRight(numBits: Int): Long {
} }
internal fun Long.shiftRightUnsigned(numBits: Int): Long { internal fun Long.shiftRightUnsigned(numBits: Int): Long {
@Suppress("NAME_SHADOWING")
val numBits = numBits and 63 val numBits = numBits and 63
if (numBits == 0) { if (numBits == 0) {
return this return this
@@ -51,6 +51,7 @@ internal fun <T> taggedArrayCopy(array: dynamic): T {
} }
@PublishedApi @PublishedApi
@Suppress("NOTHING_TO_INLINE")
internal inline fun withType(type: String, array: dynamic): dynamic { internal inline fun withType(type: String, array: dynamic): dynamic {
array.`$type$` = type array.`$type$` = type
return array return array
@@ -7,15 +7,15 @@ package kotlin.js
internal fun numberToByte(a: dynamic): Byte = toByte(numberToInt(a)) internal fun numberToByte(a: dynamic): Byte = toByte(numberToInt(a))
internal fun numberToDouble(a: dynamic): Double = js("+a").unsafeCast<Double>() internal fun numberToDouble(@Suppress("UNUSED_PARAMETER") a: dynamic): Double = js("+a").unsafeCast<Double>()
internal fun numberToInt(a: dynamic): Int = if (a is Long) a.toInt() else doubleToInt(a) internal fun numberToInt(a: dynamic): Int = if (a is Long) a.toInt() else doubleToInt(a)
internal fun numberToShort(a: dynamic): Short = toShort(numberToInt(a)) internal fun numberToShort(a: dynamic): Short = toShort(numberToInt(a))
// << and >> shifts are used to preserve sign of the number // << and >> shifts are used to preserve sign of the number
internal fun toByte(a: dynamic): Byte = js("a << 24 >> 24").unsafeCast<Byte>() internal fun toByte(@Suppress("UNUSED_PARAMETER") a: dynamic): Byte = js("a << 24 >> 24").unsafeCast<Byte>()
internal fun toShort(a: dynamic): Short = js("a << 16 >> 16").unsafeCast<Short>() internal fun toShort(@Suppress("UNUSED_PARAMETER") a: dynamic): Short = js("a << 16 >> 16").unsafeCast<Short>()
internal fun numberToLong(a: dynamic): Long = if (a is Long) a else fromNumber(a) internal fun numberToLong(a: dynamic): Long = if (a is Long) a else fromNumber(a)
@@ -33,7 +33,8 @@ private fun getKPropMetadata(paramCount: Int, setter: Any?, type: dynamic): dyna
return mdata return mdata
} }
inline private fun metadataObject(): dynamic = js("{ kind: 'class', interfaces: [] }") @Suppress("NOTHING_TO_INLINE")
private inline fun metadataObject(): dynamic = js("{ kind: 'class', interfaces: [] }")
private val propertyRefClassMetadataCache: Array<Array<dynamic>> = arrayOf<Array<dynamic>>( private val propertyRefClassMetadataCache: Array<Array<dynamic>> = arrayOf<Array<dynamic>>(
// immutable , mutable // immutable , mutable
@@ -76,6 +76,7 @@ public fun isInterface(ctor: dynamic, IType: dynamic): Boolean {
internal fun isSuspendFunction(obj: dynamic, arity: Int): Boolean { internal fun isSuspendFunction(obj: dynamic, arity: Int): Boolean {
if (jsTypeOf(obj) == "function") { if (jsTypeOf(obj) == "function") {
@Suppress("DEPRECATED_IDENTITY_EQUALS")
return obj.`$arity`.unsafeCast<Int>() === arity return obj.`$arity`.unsafeCast<Int>() === arity
} }
@@ -106,7 +107,7 @@ internal fun isArrayish(o: dynamic) =
isJsArray(o) || js("ArrayBuffer").isView(o).unsafeCast<Boolean>() isJsArray(o) || js("ArrayBuffer").isView(o).unsafeCast<Boolean>()
internal fun isChar(c: Any): Boolean { internal fun isChar(@Suppress("UNUSED_PARAMETER") c: Any): Boolean {
error("isChar is not implemented") error("isChar is not implemented")
} }
@@ -173,10 +173,12 @@ public actual fun CharArray.asList(): List<Char> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: Char): Int { override fun indexOf(element: Char): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is Char) return -1 if ((element as Any?) !is Char) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: Char): Int { override fun lastIndexOf(element: Char): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is Char) return -1 if ((element as Any?) !is Char) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -73,10 +73,12 @@ public actual fun UIntArray.asList(): List<UInt> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: UInt): Int { override fun indexOf(element: UInt): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UInt) return -1 if ((element as Any?) !is UInt) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: UInt): Int { override fun lastIndexOf(element: UInt): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UInt) return -1 if ((element as Any?) !is UInt) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -98,10 +100,12 @@ public actual fun ULongArray.asList(): List<ULong> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: ULong): Int { override fun indexOf(element: ULong): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is ULong) return -1 if ((element as Any?) !is ULong) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: ULong): Int { override fun lastIndexOf(element: ULong): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is ULong) return -1 if ((element as Any?) !is ULong) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -123,10 +127,12 @@ public actual fun UByteArray.asList(): List<UByte> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: UByte): Int { override fun indexOf(element: UByte): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UByte) return -1 if ((element as Any?) !is UByte) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: UByte): Int { override fun lastIndexOf(element: UByte): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UByte) return -1 if ((element as Any?) !is UByte) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -148,10 +154,12 @@ public actual fun UShortArray.asList(): List<UShort> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: UShort): Int { override fun indexOf(element: UShort): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UShort) return -1 if ((element as Any?) !is UShort) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: UShort): Int { override fun lastIndexOf(element: UShort): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UShort) return -1 if ((element as Any?) !is UShort) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -96,7 +96,7 @@ internal fun subSequence(c: CharSequence, startIndex: Int, endIndex: Int): CharS
} }
@JsName("captureStack") @JsName("captureStack")
internal fun captureStack(baseClass: JsClass<in Throwable>, instance: Throwable) { internal fun captureStack(@Suppress("UNUSED_PARAMETER") baseClass: JsClass<in Throwable>, instance: Throwable) {
if (js("Error").captureStackTrace) { if (js("Error").captureStackTrace) {
// Using uncropped stack traces due to KT-37563. // Using uncropped stack traces due to KT-37563.
// Precise stack traces are implemented in JS IR compiler and stdlib // Precise stack traces are implemented in JS IR compiler and stdlib
@@ -9,6 +9,8 @@ package kotlin.js
// Used for js.translator/testData/box/number/mulInt32.kt // Used for js.translator/testData/box/number/mulInt32.kt
@library @library
@JsName("imulEmulated") @JsName("imulEmulated")
@Suppress("UNUSED_PARAMETER")
internal fun imul(x: Int, y: Int): Int = definedExternally internal fun imul(x: Int, y: Int): Int = definedExternally
internal inline fun isArrayish(o: dynamic) = js("Kotlin").isArrayish(o) @Suppress("NOTHING_TO_INLINE")
internal inline fun isArrayish(o: dynamic) = js("Kotlin").isArrayish(o)
@@ -61,6 +61,7 @@ public actual fun Float.toRawBits(): Int = definedExternally
public actual inline fun Float.Companion.fromBits(bits: Int): Float = js("Kotlin").floatFromBits(bits).unsafeCast<Float>() public actual inline fun Float.Companion.fromBits(bits: Int): Float = js("Kotlin").floatFromBits(bits).unsafeCast<Float>()
@Suppress("NOTHING_TO_INLINE")
internal inline fun Long(low: Int, high: Int) = js("Kotlin").Long.fromBits(low, high).unsafeCast<Long>() internal inline fun Long(low: Int, high: Int) = js("Kotlin").Long.fromBits(low, high).unsafeCast<Long>()
internal inline val Long.low: Int get() = this.asDynamic().getLowBits().unsafeCast<Int>() internal inline val Long.low: Int get() = this.asDynamic().getLowBits().unsafeCast<Int>()
internal inline val Long.high: Int get() = this.asDynamic().getHighBits().unsafeCast<Int>() internal inline val Long.high: Int get() = this.asDynamic().getHighBits().unsafeCast<Int>()
@@ -6,7 +6,7 @@
import kotlin.reflect.KClass import kotlin.reflect.KClass
@PublishedApi @PublishedApi
internal fun <T : Annotation> KClass<*>.findAssociatedObject(annotationClass: KClass<T>): Any? { internal fun <T : Annotation> KClass<*>.findAssociatedObject(@Suppress("UNUSED_PARAMETER") annotationClass: KClass<T>): Any? {
// This API is not supported in js-v1. Return `null` to be source-compatible with js-ir. // This API is not supported in js-v1. Return `null` to be source-compatible with js-ir.
return null return null
} }
@@ -173,10 +173,12 @@ public actual fun CharArray.asList(): List<Char> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: Char): Int { override fun indexOf(element: Char): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is Char) return -1 if ((element as Any?) !is Char) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: Char): Int { override fun lastIndexOf(element: Char): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is Char) return -1 if ((element as Any?) !is Char) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -73,10 +73,12 @@ public actual fun UIntArray.asList(): List<UInt> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: UInt): Int { override fun indexOf(element: UInt): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UInt) return -1 if ((element as Any?) !is UInt) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: UInt): Int { override fun lastIndexOf(element: UInt): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UInt) return -1 if ((element as Any?) !is UInt) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -98,10 +100,12 @@ public actual fun ULongArray.asList(): List<ULong> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: ULong): Int { override fun indexOf(element: ULong): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is ULong) return -1 if ((element as Any?) !is ULong) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: ULong): Int { override fun lastIndexOf(element: ULong): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is ULong) return -1 if ((element as Any?) !is ULong) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -123,10 +127,12 @@ public actual fun UByteArray.asList(): List<UByte> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: UByte): Int { override fun indexOf(element: UByte): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UByte) return -1 if ((element as Any?) !is UByte) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: UByte): Int { override fun lastIndexOf(element: UByte): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UByte) return -1 if ((element as Any?) !is UByte) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -148,10 +154,12 @@ public actual fun UShortArray.asList(): List<UShort> {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: UShort): Int { override fun indexOf(element: UShort): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UShort) return -1 if ((element as Any?) !is UShort) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: UShort): Int { override fun lastIndexOf(element: UShort): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is UShort) return -1 if ((element as Any?) !is UShort) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }
@@ -125,7 +125,7 @@ private class TypeVariableImpl(private val typeParameter: KTypeParameter) : Type
// [TypeVariable] extends [AnnotatedElement] starting from JDK 8. The following are copies of methods from there. // [TypeVariable] extends [AnnotatedElement] starting from JDK 8. The following are copies of methods from there.
// Suppression of VIRTUAL_MEMBER_HIDDEN is needed for cases when environment variable JDK_16 points to JDK 8+. // Suppression of VIRTUAL_MEMBER_HIDDEN is needed for cases when environment variable JDK_16 points to JDK 8+.
@Suppress("VIRTUAL_MEMBER_HIDDEN") @Suppress("VIRTUAL_MEMBER_HIDDEN", "UNUSED_PARAMETER")
fun <T : Annotation> getAnnotation(annotationClass: Class<T>): T? = null fun <T : Annotation> getAnnotation(annotationClass: Class<T>): T? = null
@Suppress("VIRTUAL_MEMBER_HIDDEN") @Suppress("VIRTUAL_MEMBER_HIDDEN")
@@ -5,6 +5,7 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("StringsKt") @file:kotlin.jvm.JvmName("StringsKt")
@file:Suppress("EXTENSION_SHADOWED_BY_MEMBER")
package kotlin.text package kotlin.text
@@ -299,7 +299,6 @@ public inline fun <R, T : R> Result<T>.recover(transform: (exception: Throwable)
@InlineOnly @InlineOnly
@SinceKotlin("1.3") @SinceKotlin("1.3")
public inline fun <R, T : R> Result<T>.recoverCatching(transform: (exception: Throwable) -> R): Result<R> { public inline fun <R, T : R> Result<T>.recoverCatching(transform: (exception: Throwable) -> R): Result<R> {
val value = value // workaround for inline classes BE bug
return when (val exception = exceptionOrNull()) { return when (val exception = exceptionOrNull()) {
null -> this null -> this
else -> runCatching { transform(exception) } else -> runCatching { transform(exception) }
@@ -50,6 +50,7 @@ internal constructor(@PublishedApi internal val storage: ByteArray) : Collection
override fun contains(element: UByte): Boolean { override fun contains(element: UByte): Boolean {
// TODO: Eliminate this check after KT-30016 gets fixed. // TODO: Eliminate this check after KT-30016 gets fixed.
// Currently JS BE does not generate special bridge method for this method. // Currently JS BE does not generate special bridge method for this method.
@Suppress("USELESS_CAST")
if ((element as Any?) !is UByte) return false if ((element as Any?) !is UByte) return false
return storage.contains(element.toByte()) return storage.contains(element.toByte())
@@ -50,6 +50,7 @@ internal constructor(@PublishedApi internal val storage: IntArray) : Collection<
override fun contains(element: UInt): Boolean { override fun contains(element: UInt): Boolean {
// TODO: Eliminate this check after KT-30016 gets fixed. // TODO: Eliminate this check after KT-30016 gets fixed.
// Currently JS BE does not generate special bridge method for this method. // Currently JS BE does not generate special bridge method for this method.
@Suppress("USELESS_CAST")
if ((element as Any?) !is UInt) return false if ((element as Any?) !is UInt) return false
return storage.contains(element.toInt()) return storage.contains(element.toInt())
@@ -50,6 +50,7 @@ internal constructor(@PublishedApi internal val storage: LongArray) : Collection
override fun contains(element: ULong): Boolean { override fun contains(element: ULong): Boolean {
// TODO: Eliminate this check after KT-30016 gets fixed. // TODO: Eliminate this check after KT-30016 gets fixed.
// Currently JS BE does not generate special bridge method for this method. // Currently JS BE does not generate special bridge method for this method.
@Suppress("USELESS_CAST")
if ((element as Any?) !is ULong) return false if ((element as Any?) !is ULong) return false
return storage.contains(element.toLong()) return storage.contains(element.toLong())
@@ -50,6 +50,7 @@ internal constructor(@PublishedApi internal val storage: ShortArray) : Collectio
override fun contains(element: UShort): Boolean { override fun contains(element: UShort): Boolean {
// TODO: Eliminate this check after KT-30016 gets fixed. // TODO: Eliminate this check after KT-30016 gets fixed.
// Currently JS BE does not generate special bridge method for this method. // Currently JS BE does not generate special bridge method for this method.
@Suppress("USELESS_CAST")
if ((element as Any?) !is UShort) return false if ((element as Any?) !is UShort) return false
return storage.contains(element.toShort()) return storage.contains(element.toShort())
@@ -1509,10 +1509,12 @@ object ArrayOps : TemplateGroupBase() {
return this@asList[index] return this@asList[index]
} }
override fun indexOf(element: T): Int { override fun indexOf(element: T): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is T) return -1 if ((element as Any?) !is T) return -1
return this@asList.indexOf(element) return this@asList.indexOf(element)
} }
override fun lastIndexOf(element: T): Int { override fun lastIndexOf(element: T): Int {
@Suppress("USELESS_CAST")
if ((element as Any?) !is T) return -1 if ((element as Any?) !is T) return -1
return this@asList.lastIndexOf(element) return this@asList.lastIndexOf(element)
} }