Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

22 lines
586 B
Kotlin
Vendored
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_EXPRESSION
inline fun <reified T> foo() {
<!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>T::<!UNRESOLVED_REFERENCE!>toString<!><!>
}
inline fun <reified T> f(): T = throw UnsupportedOperationException()
fun <T> id(p: T): T = p
fun <A> main() {
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>f<!>()
val a: A = <!TYPE_PARAMETER_AS_REIFIED!>f<!>()
f<<!TYPE_PARAMETER_AS_REIFIED!>A<!>>()
val b: Int = f()
f<Int>()
val с: A = id(<!TYPE_PARAMETER_AS_REIFIED!>f<!>())
}