Don't create KProperty instance for synthetic field

#KT-5759 Fixed
This commit is contained in:
Alexander Udalov
2015-03-19 20:51:24 +03:00
parent a5a60b6917
commit 7e69a5ac9a
3 changed files with 26 additions and 3 deletions
@@ -0,0 +1,14 @@
import kotlin.reflect.jvm.kotlin
class A {
// There's a synthetic "$kotlinClass" field here
}
fun box(): String {
for (field in javaClass<A>().getDeclaredFields()) {
val prop = field.kotlin
if (prop != null) return "Fail, property found: $prop"
}
return "OK"
}