Files
kotlin-fork/compiler/testData/codegen/boxInline/signature/outProjectionSubstitution.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

36 lines
886 B
Kotlin
Vendored

// IGNORE_BACKEND: NATIVE
// FILE: 1.kt
// WITH_REFLECT
package test
interface F<T> {
fun test(p: T) : Int
}
inline fun <T> Array<T>.copyOfRange1(crossinline toIndex: () -> Int) =
object : F<T> {
override fun test(p: T): Int {
return toIndex()
}
}
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
import test.*
import java.util.*
public fun Array<out CharSequence>.slice1() = copyOfRange1 { 1 }
fun box(): String {
val comparable = arrayOf("123").slice1()
val method = comparable.javaClass.getMethod("test", Any::class.java)
val genericParameterTypes = method.genericParameterTypes
if (genericParameterTypes.size != 1) return "fail 1: ${genericParameterTypes.size}"
var name = (genericParameterTypes[0] as Class<*>).name
if (name != "java.lang.CharSequence") return "fail 2: ${name}"
return "OK"
}