Minor, explain why we don't store array type arguments in ::class in proto

This commit is contained in:
Alexander Udalov
2019-02-13 15:58:11 +01:00
parent 736ac12374
commit 76e133014b
3 changed files with 51 additions and 17 deletions
@@ -2643,7 +2643,9 @@ public final class DebugProtoBuf {
* - Array<String>::class, if array_dimension_count = 1
* - Array<Array<String>>::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
* </pre>
*/
boolean hasArrayDimensionCount();
@@ -2657,7 +2659,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
int getArrayDimensionCount();
@@ -3220,7 +3224,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -3236,7 +3242,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4365,7 +4373,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -4381,7 +4391,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4397,7 +4409,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder setArrayDimensionCount(int value) {
@@ -4416,7 +4430,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder clearArrayDimensionCount() {
+3 -1
View File
@@ -90,7 +90,9 @@ message Annotation {
// - Array<String>::class, if array_dimension_count = 1
// - Array<Array<String>>::class, if array_dimension_count = 2
// - etc.
// Other forms of array class literals are not supported by this format, see KT-26568
// Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
// in class literals on JVM, we don't bother to do represent this in our format as well.
// So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
optional int32 array_dimension_count = 11 [default = 0];
/*
@@ -2211,7 +2211,9 @@ public final class ProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
boolean hasArrayDimensionCount();
@@ -2225,7 +2227,9 @@ public final class ProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
int getArrayDimensionCount();
@@ -2749,7 +2753,9 @@ public final class ProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -2765,7 +2771,9 @@ public final class ProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -3652,7 +3660,9 @@ public final class ProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -3668,7 +3678,9 @@ public final class ProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -3684,7 +3696,9 @@ public final class ProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder setArrayDimensionCount(int value) {
@@ -3703,7 +3717,9 @@ public final class ProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder clearArrayDimensionCount() {