Files
kotlin-fork/compiler/testData/codegen/boxInline/reified/dontSubstituteNonReified.kt
T
2021-02-02 17:53:52 +03:00

18 lines
321 B
Kotlin
Vendored

// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt
package test
interface A
class B : A
inline fun <T : A> foo(a: Any) = (a as? T != null).toString()[0]
// FILE: 2.kt
import test.*
fun box(): String {
val s = "" + foo<B>(Any()) + foo<B>(object : A {}) + foo<B>(B())
if (s != "ftt") return "fail: $s"
return "OK"
}