Prohibit using dynamic as an argument for reified type parameters

This commit is contained in:
Andrey Breslav
2014-11-25 14:25:30 +03:00
parent d5fdfcb797
commit 304d22553c
7 changed files with 43 additions and 10 deletions
@@ -3,12 +3,12 @@
inline fun<reified T> foo(block: () -> T): String = block().toString()
fun box() {
val a = <!REIFIED_TYPE_NOTHING_SUBSTITUTION!>array<!>(null!!)
val b = <!REIFIED_TYPE_NOTHING_SUBSTITUTION!>Array<!><Nothing?>(5) { null!! }
val c = <!REIFIED_TYPE_NOTHING_SUBSTITUTION!>foo<!>() { null!! }
val a = <!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>array<!>(null!!)
val b = <!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>Array<!><Nothing?>(5) { null!! }
val c = <!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>foo<!>() { null!! }
val d = foo<Any> { null!! }
val e = <!REIFIED_TYPE_NOTHING_SUBSTITUTION!>foo<!> { "1" as Nothing }
val e1 = <!REIFIED_TYPE_NOTHING_SUBSTITUTION!>foo<!> { "1" as Nothing? }
val e = <!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>foo<!> { "1" as Nothing }
val e1 = <!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>foo<!> { "1" as Nothing? }
val f = <!REIFIED_TYPE_NOTHING_SUBSTITUTION!>javaClass<!><Nothing>()
val f = <!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>javaClass<!><Nothing>()
}