Remove synthetic flag from internal members

This commit is contained in:
Michael Bogdanov
2015-10-09 18:40:51 +03:00
parent 4f63d47f82
commit ee6dbac381
12 changed files with 32 additions and 13 deletions
@@ -214,7 +214,6 @@ public class AsmUtil {
}
if (JetTypeMapper.isAccessor(functionDescriptor)
|| functionDescriptor.getVisibility() == Visibilities.INTERNAL
|| AnnotationUtilKt.hasJvmSyntheticAnnotation(functionDescriptor)) {
flags |= ACC_SYNTHETIC;
}
@@ -337,10 +337,6 @@ public class PropertyCodegen {
modifiers |= ACC_PRIVATE;
}
if (propertyDescriptor.getVisibility() == Visibilities.INTERNAL) {
modifiers |= ACC_SYNTHETIC;
}
if (AsmUtil.isPropertyWithBackingFieldCopyInOuterClass(propertyDescriptor)) {
ImplementationBodyCodegen parentBodyCodegen = (ImplementationBodyCodegen) memberCodegen.getParentCodegen();
parentBodyCodegen.addCompanionObjectPropertyToCopy(propertyDescriptor, defaultValue);
@@ -10,11 +10,9 @@ fun box(): String {
val clazz = Z::class.java
val classField = clazz.getDeclaredField("noMangling")
if (classField == null) return "Class internal backing field should exist"
if (!classField.isSynthetic) return "Class internal backing field should be synthetic"
val topLevel = Class.forName("test.FieldKt").getDeclaredField("noMangling")
if (topLevel == null) return "Top level internal backing field should exist"
if (!topLevel.isSynthetic) return "Top level internal backing field should be synthetic"
return "OK"
}
@@ -14,11 +14,9 @@ fun box(): String {
it.name.startsWith("mangled$")
}
if (mangled == null) return "Class internal function should exist"
if (!mangled.isSynthetic) return "Class internal function should be synthetic"
val topLevel = Class.forName("test.FunKt").getMethod("noMangling")
if (topLevel == null) return "Top level internal function should exist"
if (!topLevel.isSynthetic) return "Top level internal function should be synthetic"
return "OK"
}
@@ -10,4 +10,4 @@ interface Test {
// TESTED_OBJECT_KIND: property
// TESTED_OBJECTS: Test$Companion, prop
// FLAGS: ACC_PUBLIC, ACC_FINAL, ACC_STATIC, ACC_SYNTHETIC
// FLAGS: ACC_PUBLIC, ACC_FINAL, ACC_STATIC
@@ -10,4 +10,4 @@ interface Test {
// TESTED_OBJECT_KIND: property
// TESTED_OBJECTS: Test$Companion, prop
// FLAGS: ACC_PUBLIC, ACC_FINAL, ACC_STATIC, ACC_SYNTHETIC
// FLAGS: ACC_PUBLIC, ACC_FINAL, ACC_STATIC
@@ -10,4 +10,4 @@ interface Test {
// TESTED_OBJECT_KIND: property
// TESTED_OBJECTS: Test$Companion, prop
// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC
// FLAGS: ACC_PUBLIC, ACC_STATIC
@@ -11,4 +11,4 @@ interface Test {
// TESTED_OBJECT_KIND: property
// TESTED_OBJECTS: Test$Companion, prop
// FLAGS: ACC_PRIVATE, ACC_STATIC, ACC_SYNTHETIC
// FLAGS: ACC_PRIVATE, ACC_STATIC
@@ -0,0 +1,12 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetNamedFunction
// OPTIONS: usages
package server
public open class Server() {
open internal fun <caret>processRequest() = "foo"
}
public class ServerEx(): Server() {
override fun processRequest() = "foofoo"
}
@@ -0,0 +1,8 @@
import server.*;
class Client {
public fun foo() {
Server().processRequest()
ServerEx().processRequest()
}
}
@@ -0,0 +1,2 @@
Function call (5: 18) Server().processRequest()
Function call (6: 20) ServerEx().processRequest()
@@ -552,6 +552,12 @@ public class JetFindUsagesTestGenerated extends AbstractJetFindUsagesTest {
doTest(fileName);
}
@TestMetadata("kotlinInternalMethodUsages.0.kt")
public void testKotlinInternalMethodUsages() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/findUsages/kotlin/findFunctionUsages/kotlinInternalMethodUsages.0.kt");
doTest(fileName);
}
@TestMetadata("kotlinLocalMethodUsages1.0.kt")
public void testKotlinLocalMethodUsages1() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/findUsages/kotlin/findFunctionUsages/kotlinLocalMethodUsages1.0.kt");