Remove synthetic flag from internal members
This commit is contained in:
@@ -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"
|
||||
}
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
+12
@@ -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"
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import server.*;
|
||||
|
||||
class Client {
|
||||
public fun foo() {
|
||||
Server().processRequest()
|
||||
ServerEx().processRequest()
|
||||
}
|
||||
}
|
||||
+2
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user