Don't create KProperty instance for synthetic field
#KT-5759 Fixed
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user