Files
kotlin/compiler/testData/codegen/box/callableReference/function/genericCallableReferenceArguments.kt
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

30 lines
779 B
Kotlin
Vendored

// IGNORE_BACKEND: JS, NATIVE
// WITH_RUNTIME
// WITH_REFLECT
import kotlin.test.assertEquals
fun <T, R> foo(x: T): R = TODO()
fun <T> fooReturnInt(x: T): Int = 1
inline fun <reified T, reified R> check(x: T, y: R, f: (T) -> R, tType: String, rType: String) {
assertEquals(tType, T::class.simpleName)
assertEquals(rType, R::class.simpleName)
}
inline fun <reified T, reified R> check(f: (T) -> R, g: (T) -> R, tType: String, rType: String) {
assertEquals(tType, T::class.simpleName)
assertEquals(rType, R::class.simpleName)
}
fun box(): String {
check("", 1, ::foo, "String", "Int")
check("", 1, ::fooReturnInt, "String", "Int")
check("", "", ::fooReturnInt, "String", "Any")
check(Int::toString, ::foo, "Int", "String")
return "OK"
}