Prohibit using array based on non-reified type parameters as reified type arguments
#KT-31227 fixed
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
// !LANGUAGE: +ProhibitNonReifiedArraysAsReifiedTypeArguments
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
inline fun <reified T> foo() {}
|
||||
|
||||
fun <T> bar() {
|
||||
foo<<!TYPE_PARAMETER_AS_REIFIED!>T<!>>()
|
||||
foo<<!TYPE_PARAMETER_AS_REIFIED_ARRAY!>Array<T><!>>()
|
||||
foo<<!TYPE_PARAMETER_AS_REIFIED_ARRAY!>Array<Array<T>><!>>()
|
||||
foo<Array<Int>>()
|
||||
foo<Array<Array<Int>>>()
|
||||
foo<IntArray>()
|
||||
foo<List<T>>()
|
||||
foo<List<Array<T>>>()
|
||||
}
|
||||
|
||||
fun test(x: Array<String>, y: Array<*>) {
|
||||
bar<Int>()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> bar(): kotlin.Unit
|
||||
public inline fun </*0*/ reified T> foo(): kotlin.Unit
|
||||
public fun test(/*0*/ x: kotlin.Array<kotlin.String>, /*1*/ y: kotlin.Array<*>): kotlin.Unit
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// !LANGUAGE: -ProhibitNonReifiedArraysAsReifiedTypeArguments
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
inline fun <reified T> foo() {}
|
||||
|
||||
fun <T> bar() {
|
||||
foo<<!TYPE_PARAMETER_AS_REIFIED!>T<!>>()
|
||||
foo<<!TYPE_PARAMETER_AS_REIFIED_ARRAY_WARNING!>Array<T><!>>()
|
||||
foo<<!TYPE_PARAMETER_AS_REIFIED_ARRAY_WARNING!>Array<Array<T>><!>>()
|
||||
foo<Array<Int>>()
|
||||
foo<Array<Array<Int>>>()
|
||||
foo<IntArray>()
|
||||
foo<List<T>>()
|
||||
foo<List<Array<T>>>()
|
||||
}
|
||||
|
||||
fun test(x: Array<String>, y: Array<*>) {
|
||||
bar<Int>()
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> bar(): kotlin.Unit
|
||||
public inline fun </*0*/ reified T> foo(): kotlin.Unit
|
||||
public fun test(/*0*/ x: kotlin.Array<kotlin.String>, /*1*/ y: kotlin.Array<*>): kotlin.Unit
|
||||
Reference in New Issue
Block a user