Add serialization for PRIVATE_TO_THIS
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
class A<in I> {
|
||||
private val foo: I = null!!
|
||||
private var bar: I = null!!
|
||||
|
||||
private val val_with_accessors: I
|
||||
get() = null!!
|
||||
|
||||
private var var_with_accessors: I
|
||||
get() = null!!
|
||||
set(value: I) {}
|
||||
|
||||
private fun bas(): I = null!!
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
internal final class A</*0*/ in I> {
|
||||
/*primary*/ public constructor A</*0*/ in I>()
|
||||
private/*private to this*/ final var bar: I
|
||||
private/*private to this*/ final fun <get-bar>(): I
|
||||
private/*private to this*/ final fun <set-bar>(/*0*/ <set-?>: I): kotlin.Unit
|
||||
private/*private to this*/ final val foo: I
|
||||
private/*private to this*/ final fun <get-foo>(): I
|
||||
private/*private to this*/ final val val_with_accessors: I
|
||||
private/*private to this*/ final fun <get-val_with_accessors>(): I
|
||||
private/*private to this*/ final var var_with_accessors: I
|
||||
private/*private to this*/ final fun <get-var_with_accessors>(): I
|
||||
private/*private to this*/ final fun <set-var_with_accessors>(/*0*/ value: I): kotlin.Unit
|
||||
private/*private to this*/ final fun bas(): I
|
||||
}
|
||||
@@ -133,13 +133,17 @@ public final class DebugProtoBuf {
|
||||
*/
|
||||
PUBLIC(3, 3),
|
||||
/**
|
||||
* <code>EXTRA = 4;</code>
|
||||
* <code>PRIVATE_TO_THIS = 4;</code>
|
||||
*/
|
||||
PRIVATE_TO_THIS(4, 4),
|
||||
/**
|
||||
* <code>EXTRA = 5;</code>
|
||||
*
|
||||
* <pre>
|
||||
* there's an extra field for the actual visibility
|
||||
* </pre>
|
||||
*/
|
||||
EXTRA(4, 4),
|
||||
EXTRA(5, 5),
|
||||
;
|
||||
|
||||
/**
|
||||
@@ -163,13 +167,17 @@ public final class DebugProtoBuf {
|
||||
*/
|
||||
public static final int PUBLIC_VALUE = 3;
|
||||
/**
|
||||
* <code>EXTRA = 4;</code>
|
||||
* <code>PRIVATE_TO_THIS = 4;</code>
|
||||
*/
|
||||
public static final int PRIVATE_TO_THIS_VALUE = 4;
|
||||
/**
|
||||
* <code>EXTRA = 5;</code>
|
||||
*
|
||||
* <pre>
|
||||
* there's an extra field for the actual visibility
|
||||
* </pre>
|
||||
*/
|
||||
public static final int EXTRA_VALUE = 4;
|
||||
public static final int EXTRA_VALUE = 5;
|
||||
|
||||
|
||||
public final int getNumber() { return value; }
|
||||
@@ -180,7 +188,8 @@ public final class DebugProtoBuf {
|
||||
case 1: return PRIVATE;
|
||||
case 2: return PROTECTED;
|
||||
case 3: return PUBLIC;
|
||||
case 4: return EXTRA;
|
||||
case 4: return PRIVATE_TO_THIS;
|
||||
case 5: return EXTRA;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@@ -17780,10 +17789,10 @@ public final class DebugProtoBuf {
|
||||
"\nDELEGATION\020\002\022\017\n\013SYNTHESIZED\020\003\":\n\014Callab" +
|
||||
"leKind\022\007\n\003FUN\020\000\022\007\n\003VAL\020\001\022\007\n\003VAR\020\002\022\017\n\013CON" +
|
||||
"STRUCTOR\020\003*\005\010d\020\310\001*-\n\010Modality\022\t\n\005FINAL\020\000" +
|
||||
"\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002*M\n\nVisibility\022\014" +
|
||||
"\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002*b\n\nVisibility\022\014" +
|
||||
"\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020\001\022\r\n\tPROTECTED\020\002",
|
||||
"\022\n\n\006PUBLIC\020\003\022\t\n\005EXTRA\020\004B\022B\rDebugProtoBuf" +
|
||||
"\210\001\000"
|
||||
"\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVATE_TO_THIS\020\004\022\t\n\005EXT" +
|
||||
"RA\020\005B\022B\rDebugProtoBuf\210\001\000"
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
|
||||
|
||||
@@ -4740,6 +4740,12 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
||||
doTestCompiledKotlin(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateToThis.kt")
|
||||
public void testPrivateToThis() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/PrivateToThis.kt");
|
||||
doTestCompiledKotlin(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateTopLevelFun.kt")
|
||||
public void testPrivateTopLevelFun() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/PrivateTopLevelFun.kt");
|
||||
|
||||
@@ -299,5 +299,6 @@ enum Visibility {
|
||||
PRIVATE = 0x01;
|
||||
PROTECTED = 0x02;
|
||||
PUBLIC = 0x03;
|
||||
EXTRA = 0x04; // there's an extra field for the actual visibility
|
||||
PRIVATE_TO_THIS = 0x04;
|
||||
EXTRA = 0x05; // there's an extra field for the actual visibility
|
||||
}
|
||||
|
||||
@@ -148,6 +148,9 @@ public class Flags {
|
||||
else if (visibility == Visibilities.PRIVATE) {
|
||||
return ProtoBuf.Visibility.PRIVATE;
|
||||
}
|
||||
else if (visibility == Visibilities.PRIVATE_TO_THIS) {
|
||||
return ProtoBuf.Visibility.PRIVATE_TO_THIS;
|
||||
}
|
||||
else if (visibility == Visibilities.PROTECTED) {
|
||||
return ProtoBuf.Visibility.PROTECTED;
|
||||
}
|
||||
|
||||
@@ -107,13 +107,17 @@ public final class ProtoBuf {
|
||||
*/
|
||||
PUBLIC(3, 3),
|
||||
/**
|
||||
* <code>EXTRA = 4;</code>
|
||||
* <code>PRIVATE_TO_THIS = 4;</code>
|
||||
*/
|
||||
PRIVATE_TO_THIS(4, 4),
|
||||
/**
|
||||
* <code>EXTRA = 5;</code>
|
||||
*
|
||||
* <pre>
|
||||
* there's an extra field for the actual visibility
|
||||
* </pre>
|
||||
*/
|
||||
EXTRA(4, 4),
|
||||
EXTRA(5, 5),
|
||||
;
|
||||
|
||||
/**
|
||||
@@ -137,13 +141,17 @@ public final class ProtoBuf {
|
||||
*/
|
||||
public static final int PUBLIC_VALUE = 3;
|
||||
/**
|
||||
* <code>EXTRA = 4;</code>
|
||||
* <code>PRIVATE_TO_THIS = 4;</code>
|
||||
*/
|
||||
public static final int PRIVATE_TO_THIS_VALUE = 4;
|
||||
/**
|
||||
* <code>EXTRA = 5;</code>
|
||||
*
|
||||
* <pre>
|
||||
* there's an extra field for the actual visibility
|
||||
* </pre>
|
||||
*/
|
||||
public static final int EXTRA_VALUE = 4;
|
||||
public static final int EXTRA_VALUE = 5;
|
||||
|
||||
|
||||
public final int getNumber() { return value; }
|
||||
@@ -154,7 +162,8 @@ public final class ProtoBuf {
|
||||
case 1: return PRIVATE;
|
||||
case 2: return PROTECTED;
|
||||
case 3: return PUBLIC;
|
||||
case 4: return EXTRA;
|
||||
case 4: return PRIVATE_TO_THIS;
|
||||
case 5: return EXTRA;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ fun modality(modality: ProtoBuf.Modality) = when (modality) {
|
||||
fun visibility(visibility: ProtoBuf.Visibility) = when (visibility) {
|
||||
ProtoBuf.Visibility.INTERNAL -> Visibilities.INTERNAL
|
||||
ProtoBuf.Visibility.PRIVATE -> Visibilities.PRIVATE
|
||||
ProtoBuf.Visibility.PRIVATE_TO_THIS -> Visibilities.PRIVATE_TO_THIS
|
||||
ProtoBuf.Visibility.PROTECTED -> Visibilities.PROTECTED
|
||||
ProtoBuf.Visibility.PUBLIC -> Visibilities.PUBLIC
|
||||
ProtoBuf.Visibility.EXTRA -> throw UnsupportedOperationException("Extra visibilities are not supported yet")
|
||||
|
||||
@@ -2969,6 +2969,12 @@ public class ResolveByStubTestGenerated extends AbstractResolveByStubTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateToThis.kt")
|
||||
public void testPrivateToThis() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/PrivateToThis.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateTopLevelFun.kt")
|
||||
public void testPrivateTopLevelFun() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/PrivateTopLevelFun.kt");
|
||||
|
||||
Reference in New Issue
Block a user