Report unsupported on using underscored type argument if the corresponding feature is disabled

This commit is contained in:
Victor Petukhov
2021-10-27 11:24:04 +03:00
parent 8a99aa4b42
commit d1acb09add
3 changed files with 8 additions and 3 deletions
@@ -1,4 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: -PartiallySpecifiedTypeArguments
// !DIAGNOSTICS: -UNCHECKED_CAST
// WITH_RUNTIME
@@ -1,9 +1,10 @@
// !LANGUAGE: -PartiallySpecifiedTypeArguments
// !DIAGNOSTICS: -UNCHECKED_CAST
// WITH_RUNTIME
fun <K, T> foo(x: (K) -> T): Pair<K, T> = (1 as K) to (1f as T)
fun box(): String {
val x = foo<Int, <!UNRESOLVED_REFERENCE!>_<!>> { it.toFloat() } // Pair<Int, Float>
val x = foo<Int, <!UNSUPPORTED("underscored type argument")!>_<!>> { it.toFloat() } // Pair<Int, Float>
return "OK"
}