mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 00:21:35 +00:00
Migrate boxWithJava tests to multi-file framework
This commit is contained in:
22
compiler/testData/codegen/boxWithJava/reflection/javaStaticField.kt
vendored
Normal file
22
compiler/testData/codegen/boxWithJava/reflection/javaStaticField.kt
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
static String x;
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
fun box(): String {
|
||||
val f = J::x
|
||||
assertEquals("x", f.name)
|
||||
|
||||
assertEquals(f, J::class.members.single { it.name == "x" })
|
||||
|
||||
f.set("OK")
|
||||
assertEquals("OK", J.x)
|
||||
assertEquals("OK", f.getter())
|
||||
|
||||
return f.get()
|
||||
}
|
||||
Reference in New Issue
Block a user