Files
kotlin/compiler/testData/codegen/java8/boxWithJava/reflection/realParameterNames/K.kt
Alexander Udalov 89f3cfc704 Support parameter names for Java 8 classes in reflection
Also support specifying additional options to javac in codegen tests, which was
needed to compile Java sources with the "-parameters" option
2015-08-28 21:11:01 +03:00

16 lines
507 B
Kotlin
Vendored

// JAVAC_OPTIONS: -parameters
import kotlin.test.assertEquals
fun box(): String {
val methodParam = J::foo.parameters.single()
if (methodParam.name == null) return "Fail: method parameter has no name"
assertEquals("methodParam", methodParam.name)
val constructorParam = J::class.constructors.single().parameters.single()
if (constructorParam.name == null) return "Fail: constructor parameter has no name"
assertEquals("constructorParam", constructorParam.name)
return "OK"
}