KT-8575 Add tests and disable reflection for Java synthetic property references
This commit is contained in:
committed by
teamcity
parent
5116bbc440
commit
f8fd23e373
+35
@@ -0,0 +1,35 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
// WITH_STDLIB
|
||||
// FILE: J.java
|
||||
|
||||
public class J implements K {
|
||||
private String foo;
|
||||
|
||||
@Override
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFoo(String s) {
|
||||
foo = s;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
interface K {
|
||||
var foo: String
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val p = J::foo
|
||||
assertEquals("foo", p.name)
|
||||
|
||||
val j = J()
|
||||
p.set(j, "OK")
|
||||
return p.get(j)
|
||||
}
|
||||
Reference in New Issue
Block a user