Prohibit using array based on non-reified type parameters as reified type arguments

#KT-31227 fixed
This commit is contained in:
Ilya Chernikov
2019-11-14 08:22:04 +01:00
parent 8a1f8714e7
commit 27ff2d7816
13 changed files with 131 additions and 16 deletions
@@ -1,4 +1,5 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNCHECKED_CAST -USELESS_CAST
// !LANGUAGE: +ProhibitNonReifiedArraysAsReifiedTypeArguments
class A<T>
fun test1(
@@ -49,6 +50,6 @@ fun test6() = <!UNSUPPORTED!>foo<!><Nothing>()
class B<T>(val array: Array<T>)
fun <T> bar() = B<Array<T>>(arrayOf())
fun <T> bar() = B<Array<T>>(<!TYPE_PARAMETER_AS_REIFIED_ARRAY!>arrayOf<!>())
fun test7() = <!UNSUPPORTED!>bar<!><Nothing>()