Suppress UNCHECKED_CAST instead of CAST_NEVER_SUCCEEDS in several places

This is related to KT-6611 being fixed recently. Note that not all cases of
incorrect "cast never succeeds" were fixed
This commit is contained in:
Alexander Udalov
2016-07-12 21:32:35 +03:00
parent 13b0fda3c2
commit 8f33830f29
10 changed files with 15 additions and 17 deletions
+2 -2
View File
@@ -22,5 +22,5 @@ import kotlin.internal.PureReifiable
* Returns an empty array of the specified type [T].
*/
public inline fun <reified @PureReifiable T> emptyArray(): Array<T> =
@Suppress("CAST_NEVER_SUCCEEDS")
arrayOfNulls<T>(0) as Array<T>
@Suppress("UNCHECKED_CAST")
(arrayOfNulls<T>(0) as Array<T>)
@@ -21,7 +21,7 @@ abstract class PrimitiveSpreadBuilder<T : Any>(private val size: Int) {
protected var position: Int = 0
@Suppress("CAST_NEVER_SUCCEEDS")
@Suppress("UNCHECKED_CAST")
private val spreads: Array<T?> = arrayOfNulls<Any>(size) as Array<T?>
fun addSpread(spreadArgument: T) {