Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt
T
2021-05-25 13:28:27 +03:00

22 lines
533 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!>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<!>())
}