Files
kotlin-fork/compiler/testData/codegen/box/reified/reifiedInlineFunOfObject.kt
T
Ilya Matveev a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00

27 lines
643 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// WITH_RUNTIME
import kotlin.test.assertEquals
fun foo(block: () -> String) = block()
interface A {
fun f(): String
fun g(): String
}
fun box(): String {
val x: A = object : A {
private inline fun <reified T : Any> localClassName(): String = T::class.java.getName()
override fun f(): String = foo { localClassName<String>() }
override fun g(): String = foo { localClassName<Int>() }
}
assertEquals("java.lang.String", x.f())
assertEquals("java.lang.Integer", x.g())
return "OK"
}