Serialize/Deserialize const modifier

This commit is contained in:
Denis Zharkov
2015-09-21 16:34:20 +03:00
parent b2b76d16d0
commit 98dd08109d
10 changed files with 69 additions and 9 deletions
@@ -179,10 +179,12 @@ public class DescriptorSerializer {
boolean hasSetter = false;
boolean hasConstant = false;
boolean lateInit = false;
boolean isConst = false;
if (descriptor instanceof PropertyDescriptor) {
PropertyDescriptor propertyDescriptor = (PropertyDescriptor) descriptor;
lateInit = propertyDescriptor.isLateInit();
isConst = propertyDescriptor.isConst();
int propertyFlags = Flags.getAccessorFlags(
hasAnnotations(propertyDescriptor),
@@ -232,7 +234,8 @@ public class DescriptorSerializer {
hasGetter,
hasSetter,
hasConstant,
lateInit
lateInit,
isConst
));
for (TypeParameterDescriptor typeParameterDescriptor : descriptor.getTypeParameters()) {
+14
View File
@@ -0,0 +1,14 @@
//ALLOW_AST_ACCESS
package test
const private val topLevel = 1
object A {
const protected val inObject = 2
}
class B {
companion object {
const val inCompanion = 3
}
}
@@ -0,0 +1,20 @@
package test
private const val topLevel: kotlin.Int = 1
private fun <get-topLevel>(): kotlin.Int
public object A {
/*primary*/ private constructor A()
protected const final val inObject: kotlin.Int = 2
protected final fun <get-inObject>(): kotlin.Int
}
public final class B {
/*primary*/ public constructor B()
public companion object Companion {
/*primary*/ private constructor Companion()
public const final val inCompanion: kotlin.Int = 3
public final fun <get-inCompanion>(): kotlin.Int
}
}
@@ -4471,6 +4471,12 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
doTestCompiledKotlin(fileName);
}
@TestMetadata("Const.kt")
public void testConst() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/prop/Const.kt");
doTestCompiledKotlin(fileName);
}
@TestMetadata("Constants.kt")
public void testConstants() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/prop/Constants.kt");
@@ -2580,6 +2580,12 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
doTest(fileName);
}
@TestMetadata("Const.kt")
public void testConst() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/prop/Const.kt");
doTest(fileName);
}
@TestMetadata("Constants.kt")
public void testConstants() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/prop/Constants.kt");