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"
|
||||
}
|
||||
+6
@@ -2782,6 +2782,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
|
||||
doTestWithStdlib(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("syntheticFields.kt")
|
||||
public void testSyntheticFields() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/syntheticFields.kt");
|
||||
doTestWithStdlib(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelProperty.kt")
|
||||
public void testTopLevelProperty() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/topLevelProperty.kt");
|
||||
|
||||
Reference in New Issue
Block a user