Adding most recent work

pull/8272/head
Deanna Garcia 4 years ago
parent 73e0e7af12
commit eef241890a
  1. 6
      java/core/generate-test-sources-build.xml
  2. 208
      java/core/output.txt
  3. 18
      java/core/pom.xml
  4. 28
      java/core/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensionsLite.kt
  5. 98
      java/core/src/test/kotlin/com/google/protobuf/DslListTest.kt
  6. 164
      java/core/src/test/kotlin/com/google/protobuf/DslMapTest.kt
  7. 60
      java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt
  8. 125
      java/core/src/test/kotlin/com/google/protobuf/ExtensionListTest.kt
  9. 59
      java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt
  10. 340
      java/core/src/test/kotlin/com/google/protobuf/Proto3Test.kt
  11. 5
      java/core/src/test/proto/com/google/protobuf/evil_names_proto3.proto
  12. 4
      java/core/src/test/proto/com/google/protobuf/example_extensible_message.proto
  13. 4
      java/core/src/test/proto/com/google/protobuf/multiple_files_proto3.proto
  14. 14
      java/lite/generate-test-sources-build.xml
  15. 50
      java/lite/pom.xml
  16. 4
      java/lite/src/test/kotlin/com/google/protobuf/ExtendableMessageLiteExtensionsTest.kt
  17. 85
      java/lite/src/test/kotlin/com/google/protobuf/Proto2LiteTest.kt

@ -26,6 +26,7 @@
<arg value="${test.proto.dir}/com/google/protobuf/deprecated_file.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto3.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/example_extensible_message.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/field_presence_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/lazy_fields_lite.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/lite_equals_and_hash.proto"/>
@ -35,6 +36,7 @@
<arg value="${test.proto.dir}/com/google/protobuf/map_lite_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/map_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/message_lite_extension_util_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/multiple_files_proto3.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/multiple_files_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/nested_builders_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/nested_extension.proto"/>
@ -48,7 +50,6 @@
<arg value="${test.proto.dir}/com/google/protobuf/proto2_unknown_enum_values.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/proto3_message.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/proto3_message_lite.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/test_bad_identifiers.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/test_check_utf8.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/test_check_utf8_size.proto"/>
@ -70,7 +71,10 @@
<arg value="--experimental_allow_proto3_optional"/>
<arg value="${protobuf.source.dir}/google/protobuf/map_proto2_unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_proto3.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto3.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/multiple_files_proto3.proto"/>
</exec>
</project>

@ -52,6 +52,10 @@ main:
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java: Some input files use unchecked or unsafe operations.
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- kotlin-maven-plugin:1.4.31:compile (compile) @ protobuf-java ---
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt: (8, 2) This class can only be used with the compiler argument '-Xopt-in=kotlin.RequiresOptIn'
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt: (14, 11) This class can only be used with the compiler argument '-Xopt-in=kotlin.RequiresOptIn'
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (generate-test-sources) @ protobuf-java ---
[INFO] Executing tasks
@ -99,168 +103,66 @@ main:
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ protobuf-java ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 176 source files to /usr/local/google/home/deannagarcia/protobuf/java/core/target/test-classes
[INFO] Compiling 182 source files to /usr/local/google/home/deannagarcia/protobuf/java/core/target/test-classes
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java: Some input files use or override a deprecated API.
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- kotlin-maven-plugin:1.4.31:test-compile (test-compile) @ protobuf-java ---
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (452, 52) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (453, 52) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (454, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (455, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (456, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (457, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (458, 54) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (459, 54) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (460, 55) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (461, 55) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (462, 52) Assignment operators ambiguity:
public operator fun <T> Collection<Float!>.plus(element: Float!): List<Float!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Float!, UnittestProto.TestAllExtensions>.plusAssign(value: Float!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (463, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Double!>.plus(element: Double!): List<Double!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Double!, UnittestProto.TestAllExtensions>.plusAssign(value: Double!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (464, 51) Assignment operators ambiguity:
public operator fun <T> Collection<Boolean!>.plus(element: Boolean!): List<Boolean!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Boolean!, UnittestProto.TestAllExtensions>.plusAssign(value: Boolean!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (465, 53) Assignment operators ambiguity:
public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (466, 52) Assignment operators ambiguity:
public operator fun <T> Collection<Serializable!>.plus(elements: Iterable<Serializable!>): List<Serializable!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<ByteString!, UnittestProto.TestAllExtensions>.plusAssign(value: ByteString!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (467, 52) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.RepeatedGroup_extension!>.plus(element: UnittestProto.RepeatedGroup_extension!): List<UnittestProto.RepeatedGroup_extension!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.RepeatedGroup_extension!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.RepeatedGroup_extension!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (468, 60) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedMessage!>.plus(element: UnittestProto.TestAllTypes.NestedMessage!): List<UnittestProto.TestAllTypes.NestedMessage!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (470, 61) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.ForeignMessage!>.plus(element: UnittestProto.ForeignMessage!): List<UnittestProto.ForeignMessage!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.ForeignMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.ForeignMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (471, 60) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestImport.ImportMessage!>.plus(element: UnittestImport.ImportMessage!): List<UnittestImport.ImportMessage!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestImport.ImportMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestImport.ImportMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (473, 58) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedMessage!>.plus(element: UnittestProto.TestAllTypes.NestedMessage!): List<UnittestProto.TestAllTypes.NestedMessage!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (475, 57) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedEnum!>.plus(element: UnittestProto.TestAllTypes.NestedEnum!): List<UnittestProto.TestAllTypes.NestedEnum!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (476, 58) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.ForeignEnum!>.plus(element: UnittestProto.ForeignEnum!): List<UnittestProto.ForeignEnum!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.ForeignEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.ForeignEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (477, 57) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestImport.ImportEnum!>.plus(element: UnittestImport.ImportEnum!): List<UnittestImport.ImportEnum!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestImport.ImportEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestImport.ImportEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (478, 58) Assignment operators ambiguity:
public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (479, 51) Assignment operators ambiguity:
public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (15, 5) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, B : com.google.protobuf.GeneratedMessage.ExtendableBuilder<TypeVariable(M), TypeVariable(B)>, T> TypeVariable(B).set(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>, value: TypeVariable(T)): Unit defined in com.google.protobuf.kotlin
public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), TypeVariable(B)>, B : com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<TypeVariable(M), TypeVariable(B)>, T> TypeVariable(B).set(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>, value: TypeVariable(T)): Unit defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (15, 12) No set method providing array access
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (23, 16) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MOrBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>, T> TypeVariable(MOrBT).get(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>): TypeVariable(T) defined in com.google.protobuf.kotlin
public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>, T> TypeVariable(MorBT).get(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>): TypeVariable(T) defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (23, 23) No get method providing array access
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (31, 16) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MOrBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>, T> TypeVariable(MOrBT).get(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>): TypeVariable(T) defined in com.google.protobuf.kotlin
public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>, T> TypeVariable(MorBT).get(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>): TypeVariable(T) defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (31, 23) No get method providing array access
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (39, 41) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MorBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (46, 41) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MorBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (52, 41) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MorBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt: (58, 41) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MorBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:20 min
[INFO] Finished at: 2021-03-11T22:25:24Z
[INFO] Total time: 01:24 min
[INFO] Finished at: 2021-03-18T23:34:30Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.4.31:test-compile (test-compile) on project protobuf-java: Compilation failure: Compilation failure:
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[452,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[453,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[454,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[455,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[456,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[457,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[458,54] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[459,54] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[460,55] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[461,55] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[462,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Float!>.plus(element: Float!): List<Float!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Float!, UnittestProto.TestAllExtensions>.plusAssign(value: Float!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[463,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Double!>.plus(element: Double!): List<Double!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Double!, UnittestProto.TestAllExtensions>.plusAssign(value: Double!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[464,51] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Boolean!>.plus(element: Boolean!): List<Boolean!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Boolean!, UnittestProto.TestAllExtensions>.plusAssign(value: Boolean!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[465,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[466,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Serializable!>.plus(elements: Iterable<Serializable!>): List<Serializable!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<ByteString!, UnittestProto.TestAllExtensions>.plusAssign(value: ByteString!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[467,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.RepeatedGroup_extension!>.plus(element: UnittestProto.RepeatedGroup_extension!): List<UnittestProto.RepeatedGroup_extension!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.RepeatedGroup_extension!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.RepeatedGroup_extension!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[468,60] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedMessage!>.plus(element: UnittestProto.TestAllTypes.NestedMessage!): List<UnittestProto.TestAllTypes.NestedMessage!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[470,61] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.ForeignMessage!>.plus(element: UnittestProto.ForeignMessage!): List<UnittestProto.ForeignMessage!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.ForeignMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.ForeignMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[471,60] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestImport.ImportMessage!>.plus(element: UnittestImport.ImportMessage!): List<UnittestImport.ImportMessage!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestImport.ImportMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestImport.ImportMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[473,58] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedMessage!>.plus(element: UnittestProto.TestAllTypes.NestedMessage!): List<UnittestProto.TestAllTypes.NestedMessage!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[475,57] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedEnum!>.plus(element: UnittestProto.TestAllTypes.NestedEnum!): List<UnittestProto.TestAllTypes.NestedEnum!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[476,58] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.ForeignEnum!>.plus(element: UnittestProto.ForeignEnum!): List<UnittestProto.ForeignEnum!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.ForeignEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.ForeignEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[477,57] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestImport.ImportEnum!>.plus(element: UnittestImport.ImportEnum!): List<UnittestImport.ImportEnum!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestImport.ImportEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestImport.ImportEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[478,58] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[479,51] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[15,5] Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, B : com.google.protobuf.GeneratedMessage.ExtendableBuilder<TypeVariable(M), TypeVariable(B)>, T> TypeVariable(B).set(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>, value: TypeVariable(T)): Unit defined in com.google.protobuf.kotlin
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), TypeVariable(B)>, B : com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<TypeVariable(M), TypeVariable(B)>, T> TypeVariable(B).set(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>, value: TypeVariable(T)): Unit defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[15,12] No set method providing array access
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[23,16] Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MOrBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>, T> TypeVariable(MOrBT).get(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>): TypeVariable(T) defined in com.google.protobuf.kotlin
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>, T> TypeVariable(MorBT).get(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>): TypeVariable(T) defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[23,23] No get method providing array access
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[31,16] Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MOrBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>, T> TypeVariable(MOrBT).get(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>): TypeVariable(T) defined in com.google.protobuf.kotlin
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>, T> TypeVariable(MorBT).get(extension: ExtensionLite<TypeVariable(M), TypeVariable(T)>): TypeVariable(T) defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[31,23] No get method providing array access
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[39,41] Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MorBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[46,41] Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MorBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[52,41] Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MorBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt:[58,41] Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessage.ExtendableMessage<TypeVariable(M)>, MorBT : com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<TypeVariable(M)>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] public operator fun <M : com.google.protobuf.GeneratedMessageLite.ExtendableMessage<TypeVariable(M), *>, MorBT : com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<TypeVariable(M), *>> TypeVariable(MorBT).contains(extension: ExtensionLite<TypeVariable(M), *>): Boolean defined in com.google.protobuf.kotlin
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

@ -41,20 +41,26 @@
<artifactId>guava</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-testlib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk7</artifactId>
<version>${kotlin.version}</version>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk7</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

@ -0,0 +1,28 @@
package com.google.protobuf.kotlin
import com.google.protobuf.ExtensionLite
import com.google.protobuf.GeneratedMessageLite
/** Gets the value of the proto extension. */
operator fun <
M : GeneratedMessageLite.ExtendableMessage<M, *>,
MOrBT : GeneratedMessageLite.ExtendableMessageOrBuilder<M, *>,
T
> MOrBT.get(extension: ExtensionLite<M, T>): T = getExtension(extension)
/** Sets the current value of the proto extension in this builder. */
operator fun <
M : GeneratedMessageLite.ExtendableMessage<M, B>,
B : GeneratedMessageLite.ExtendableBuilder<M, B>,
T
> B.set(extension: ExtensionLite<M, T>, value: T) {
setExtension(extension, value)
}
/** Returns true if the specified extension is set. */
operator fun <
M : GeneratedMessageLite.ExtendableMessage<M, *>,
MorBT : GeneratedMessageLite.ExtendableMessageOrBuilder<M, *>
> MorBT.contains(
extension: ExtensionLite<M, *>
): Boolean = hasExtension(extension)

@ -0,0 +1,98 @@
package com.google.protobuf.kotlin
import com.google.common.testing.EqualsTester
import com.google.common.truth.Truth.assertThat
import kotlin.test.assertFailsWith
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
/** Tests for [DslList]. */
@RunWith(JUnit4::class)
@OptIn(OnlyForUseByGeneratedProtoCode::class)
class DslListTest {
class DummyProxy private constructor() : DslProxy()
@Test
fun matchesList() {
assertThat(DslList<Int, DummyProxy>(listOf(1, 2, 3))).containsExactly(1, 2, 3).inOrder()
}
@Test
fun reflectsChangesInList() {
val mutableList = mutableListOf(1, 2, 3)
val dslList = DslList<Int, DummyProxy>(mutableList)
mutableList.add(4)
assertThat(dslList).containsExactly(1, 2, 3, 4).inOrder()
}
@Test
fun dslListIsNotMutable() {
val dslList = DslList<Int, DummyProxy>(mutableListOf(1, 2, 3))
assertThat(dslList is MutableList<*>).isFalse()
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslListIsNotEvenSecretlyMutable() {
val dslList = DslList<Int, DummyProxy>(mutableListOf(1, 2, 3))
val dslListAsJavaUtil = dslList as java.util.List<Int>
assertFailsWith<UnsupportedOperationException> {
dslListAsJavaUtil.add(4)
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslList_IteratorIsNotEvenSecretlyMutable() {
val dslList = DslList<Int, DummyProxy>(mutableListOf(1, 2, 3))
val iterator = dslList.iterator() as java.util.Iterator<Int>
iterator.next()
assertFailsWith<UnsupportedOperationException> {
iterator.remove()
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslList_ListIteratorIsNotEvenSecretlyMutable() {
val dslList = DslList<Int, DummyProxy>(mutableListOf(1, 2, 3))
val iterator = dslList.listIterator() as java.util.ListIterator<Int>
iterator.next()
assertFailsWith<UnsupportedOperationException> {
iterator.remove()
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslList_ListIteratorIndexIsNotEvenSecretlyMutable() {
val dslList = DslList<Int, DummyProxy>(mutableListOf(1, 2, 3))
val iterator = dslList.listIterator(1) as java.util.ListIterator<Int>
iterator.next()
assertFailsWith<UnsupportedOperationException> {
iterator.remove()
}
}
@Test
fun expectedToString() {
assertThat(DslList<Int, DummyProxy>(listOf(1, 2)).toString()).isEqualTo("[1, 2]")
}
@Test
fun equality() {
EqualsTester()
.addEqualityGroup(DslList<Int, DummyProxy>(listOf(1, 2)), listOf(1, 2))
.addEqualityGroup(DslList<Int, DummyProxy>(listOf(2, 2)), listOf(2, 2))
.addEqualityGroup(
DslList<Int, DummyProxy>(emptyList()),
DslList<String, DummyProxy>(emptyList()),
emptyList<Int>()
)
.testEquals()
}
}

@ -0,0 +1,164 @@
package com.google.protobuf.kotlin
import com.google.common.testing.EqualsTester
import com.google.common.truth.Truth.assertThat
import kotlin.test.assertFailsWith
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@RunWith(JUnit4::class)
@OptIn(OnlyForUseByGeneratedProtoCode::class)
class DslMapTest {
class DummyProxy private constructor() : DslProxy()
@Test
fun matchesMap() {
assertThat(DslMap<Int, Int, DummyProxy>(mapOf(1 to -1, 2 to -2)))
.containsExactly(1, -1, 2, -2)
}
@Test
fun reflectsChangesInMap() {
val mutableMap = mutableMapOf(1 to -1, 2 to -2)
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMap)
mutableMap[3] = -3
assertThat(dslMap).containsExactly(1, -1, 2, -2, 3, -3).inOrder()
}
@Test
fun dslMapIsNotMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
assertThat(dslMap is MutableMap<*, *>).isFalse()
}
@Test
fun dslMapKeysAreNotMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
assertThat(dslMap.keys is MutableSet<*>).isFalse()
}
@Test
fun dslMapValuesAreNotMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
assertThat(dslMap.values is MutableSet<*>).isFalse()
}
@Test
fun dslMapEntriesAreNotMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
assertThat(dslMap.entries is MutableSet<*>).isFalse()
}
@Test
fun dslMapEntryObjectsAreNotMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
assertThat(dslMap.entries.single() is MutableMap.MutableEntry<*, *>).isFalse()
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslMapIsNotEvenSecretlyMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
val dslMapAsJavaUtilMap = dslMap as java.util.Map<Int, Int>
assertFailsWith<UnsupportedOperationException> {
dslMapAsJavaUtilMap.put(2, -2)
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslMapKeysAreNotEvenSecretlyMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
val dslMapKeysAsJavaUtilSet = dslMap.keys as java.util.Set<Int>
assertFailsWith<UnsupportedOperationException> {
dslMapKeysAsJavaUtilSet.remove(1)
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslMapKeysIteratorIsNotEvenSecretlyMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
val dslMapKeysAsJavaUtilSet = dslMap.keys as java.util.Set<Int>
val itr = dslMapKeysAsJavaUtilSet.iterator()
itr.next()
assertFailsWith<UnsupportedOperationException> {
itr.remove()
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslMapValuesAreNotEvenSecretlyMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
val dslMapValuesAsJavaUtilCollection = dslMap.values as java.util.Collection<Int>
assertFailsWith<UnsupportedOperationException> {
dslMapValuesAsJavaUtilCollection.remove(1)
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslMapValuesIteratorIsNotEvenSecretlyMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
val dslMapValuesAsJavaUtilCollection = dslMap.values as java.util.Collection<Int>
val itr = dslMapValuesAsJavaUtilCollection.iterator()
itr.next()
assertFailsWith<UnsupportedOperationException> {
itr.remove()
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslMapEntriesAreNotEvenSecretlyMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
val dslMapEntriesAsJavaUtilSet = dslMap.entries as java.util.Set<Map.Entry<Int, Int>>
val entry = dslMap.entries.single()
assertFailsWith<UnsupportedOperationException> {
dslMapEntriesAsJavaUtilSet.remove(entry)
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslMapEntriesIteratorIsNotEvenSecretlyMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
val dslMapEntriesAsJavaUtilSet = dslMap.entries as java.util.Set<Map.Entry<Int, Int>>
val itr = dslMapEntriesAsJavaUtilSet.iterator()
itr.next()
assertFailsWith<UnsupportedOperationException> {
itr.remove()
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun dslMapEntryObjectsAreNotEvenSecretlyMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
val dslMapEntryAsJavaUtilMapEntry = dslMap.entries.single() as java.util.Map.Entry<Int, Int>
assertFailsWith<UnsupportedOperationException> {
dslMapEntryAsJavaUtilMapEntry.value = 2
}
}
@Test
fun expectedToString() {
assertThat(DslMap<Int, Int, DummyProxy>(mapOf(1 to 2, 2 to 3)).toString())
.isEqualTo("{1=2, 2=3}")
}
@Test
fun equality() {
EqualsTester()
.addEqualityGroup(DslMap<Int, Int, DummyProxy>(mapOf(1 to 2, 2 to 3)), mapOf(1 to 2, 2 to 3))
.addEqualityGroup(DslMap<Int, Int, DummyProxy>(mapOf(1 to 3, 2 to 3)), mapOf(1 to 3, 2 to 3))
.addEqualityGroup(
DslMap<Int, Int, DummyProxy>(emptyMap()),
DslMap<String, String, DummyProxy>(emptyMap()),
emptyMap<Int, Int>()
)
.testEquals()
}
}

@ -0,0 +1,60 @@
package com.google.protobuf.kotlin
import com.google.common.truth.Truth.assertThat
import example_extensible_message.ExampleExtensibleMessage
import example_extensible_message.ExampleExtensibleMessageOuterClass as TestProto
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@RunWith(JUnit4::class)
class ExtendableMessageExtensionsTest {
@Test
fun setOnBuilder() {
val builder = ExampleExtensibleMessage.newBuilder()
builder[TestProto.int32Extension] = 5
assertThat(builder.build().getExtension(TestProto.int32Extension)).isEqualTo(5)
}
@Test
fun getOnBuilder() {
val builder = ExampleExtensibleMessage.newBuilder()
.setExtension(TestProto.int32Extension, 6)
assertThat(builder[TestProto.int32Extension]).isEqualTo(6)
}
@Test
fun getOnMessage() {
val message = ExampleExtensibleMessage.newBuilder()
.setExtension(TestProto.int32Extension, 6)
.build()
assertThat(message[TestProto.int32Extension]).isEqualTo(6)
}
@Test
fun containsPositiveOnMessage() {
val message = ExampleExtensibleMessage.newBuilder()
.setExtension(TestProto.int32Extension, 6)
.build()
assertThat(TestProto.int32Extension in message).isTrue()
}
@Test
fun containsPositiveOnBuilder() {
val builder = ExampleExtensibleMessage.newBuilder()
.setExtension(TestProto.int32Extension, 6)
assertThat(TestProto.int32Extension in builder).isTrue()
}
@Test
fun containsNegativeOnMessage() {
val message = ExampleExtensibleMessage.newBuilder().build()
assertThat(TestProto.int32Extension in message).isFalse()
}
@Test
fun containsNegativeOnBuilder() {
val builder = ExampleExtensibleMessage.newBuilder()
assertThat(TestProto.int32Extension in builder).isFalse()
}
}

@ -0,0 +1,125 @@
package com.google.protobuf.kotlin
import com.google.common.testing.EqualsTester
import com.google.common.truth.Truth.assertThat
import example_extensible_message.ExampleExtensibleMessage
import example_extensible_message.ExampleExtensibleMessageOuterClass as TestProto
import kotlin.test.assertFailsWith
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
/** Tests for [DslList]. */
@RunWith(JUnit4::class)
@OptIn(OnlyForUseByGeneratedProtoCode::class)
class ExtensionListTest {
class DummyProxy private constructor() : DslProxy()
@Test
fun matchesList() {
assertThat(
ExtensionList<Int, ExampleExtensibleMessage>(
TestProto.repeatedExtension, listOf(1, 2, 3)
)
).containsExactly(1, 2, 3).inOrder()
}
@Test
fun reflectsChangesInList() {
val mutableList = mutableListOf(1, 2, 3)
val extensionList = ExtensionList<Int, ExampleExtensibleMessage>(
TestProto.repeatedExtension, mutableList
)
mutableList.add(4)
assertThat(extensionList).containsExactly(1, 2, 3, 4).inOrder()
}
@Test
fun extensionListIsNotMutable() {
val extensionList = ExtensionList<Int, ExampleExtensibleMessage>(
TestProto.repeatedExtension, mutableListOf(1, 2, 3)
)
assertThat(extensionList is MutableList<*>).isFalse()
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun extensionListIsNotEvenSecretlyMutable() {
val extensionList = ExtensionList<Int, ExampleExtensibleMessage>(
TestProto.repeatedExtension, mutableListOf(1, 2, 3)
)
val extensionListAsJavaUtil = extensionList as java.util.List<Int>
assertFailsWith<UnsupportedOperationException> {
extensionListAsJavaUtil.add(4)
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun extensionList_IteratorIsNotEvenSecretlyMutable() {
val extensionList = ExtensionList<Int, ExampleExtensibleMessage>(
TestProto.repeatedExtension, mutableListOf(1, 2, 3)
)
val iterator = extensionList.iterator() as java.util.Iterator<Int>
iterator.next()
assertFailsWith<UnsupportedOperationException> {
iterator.remove()
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun extensionList_ListIteratorIsNotEvenSecretlyMutable() {
val extensionList = ExtensionList<Int, ExampleExtensibleMessage>(
TestProto.repeatedExtension, mutableListOf(1, 2, 3)
)
val iterator = extensionList.listIterator() as java.util.ListIterator<Int>
iterator.next()
assertFailsWith<UnsupportedOperationException> {
iterator.remove()
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
@Test
fun extensionList_ListIteratorIndexIsNotEvenSecretlyMutable() {
val extensionList = ExtensionList<Int, ExampleExtensibleMessage>(
TestProto.repeatedExtension, mutableListOf(1, 2, 3)
)
val iterator = extensionList.listIterator(1) as java.util.ListIterator<Int>
iterator.next()
assertFailsWith<UnsupportedOperationException> {
iterator.remove()
}
}
@Test
fun expectedToString() {
assertThat(
ExtensionList<Int, ExampleExtensibleMessage>(TestProto.repeatedExtension, listOf(1, 2))
.toString()
).isEqualTo("[1, 2]")
}
@Test
fun equality() {
EqualsTester()
.addEqualityGroup(
ExtensionList<Int, ExampleExtensibleMessage>(TestProto.repeatedExtension, listOf(1, 2)),
ExtensionList<Int, ExampleExtensibleMessage>(TestProto.differentExtension, listOf(1, 2)),
listOf(1, 2)
)
.addEqualityGroup(
ExtensionList<Int, ExampleExtensibleMessage>(TestProto.repeatedExtension, listOf(2, 2)),
listOf(2, 2)
)
.addEqualityGroup(
ExtensionList<Int, ExampleExtensibleMessage>(TestProto.repeatedExtension, emptyList()),
emptyList<Int>()
)
.testEquals()
}
}

@ -44,7 +44,6 @@ import org.junit.runners.JUnit4
class Proto2Test {
@Test
fun testSetters() {
val myInt: Int = 301
assertThat(
testAllTypes {
optionalInt32 = 101
@ -103,7 +102,7 @@ class Proto2Test {
repeatedImportEnum.add(ImportEnum.IMPORT_BAR)
repeatedStringPiece.add("224")
repeatedCord.add("225")
repeatedInt32 += myInt
repeatedInt32 += 301
repeatedInt64 += 302
repeatedUint32 += 303
repeatedUint64 += 304
@ -449,34 +448,34 @@ class Proto2Test {
this[UnittestProto.repeatedImportEnumExtension].add(ImportEnum.IMPORT_BAR)
this[UnittestProto.repeatedStringPieceExtension].add("224")
this[UnittestProto.repeatedCordExtension].add("225")
this[UnittestProto.repeatedInt32Extension] += 301
this[UnittestProto.repeatedInt64Extension] += 302L
this[UnittestProto.repeatedUint32Extension] += 303
this[UnittestProto.repeatedUint64Extension] += 304L
this[UnittestProto.repeatedSint32Extension] += 305
this[UnittestProto.repeatedSint64Extension] += 306L
this[UnittestProto.repeatedFixed32Extension] += 307
this[UnittestProto.repeatedFixed64Extension] += 308L
this[UnittestProto.repeatedSfixed32Extension] += 309
this[UnittestProto.repeatedSfixed64Extension] += 310L
this[UnittestProto.repeatedFloatExtension] += 311F
this[UnittestProto.repeatedDoubleExtension] += 312.0
this[UnittestProto.repeatedBoolExtension] += false
this[UnittestProto.repeatedStringExtension] += "315"
this[UnittestProto.repeatedBytesExtension] += toBytes("316")
this[UnittestProto.repeatedGroupExtension] += repeatedGroupExtension { a = 317 }
this[UnittestProto.repeatedNestedMessageExtension] +=
TestAllTypesKt.nestedMessage { bb = 318 }
this[UnittestProto.repeatedForeignMessageExtension] += foreignMessage { c = 319 }
this[UnittestProto.repeatedImportMessageExtension] +=
ImportMessage.newBuilder().setD(320).build()
this[UnittestProto.repeatedLazyMessageExtension] +=
TestAllTypesKt.nestedMessage { bb = 327 }
this[UnittestProto.repeatedNestedEnumExtension] += NestedEnum.BAZ
this[UnittestProto.repeatedForeignEnumExtension] += ForeignEnum.FOREIGN_BAZ
this[UnittestProto.repeatedImportEnumExtension] += ImportEnum.IMPORT_BAZ
this[UnittestProto.repeatedStringPieceExtension] += "324"
this[UnittestProto.repeatedCordExtension] += "325"
this[UnittestProto.repeatedInt32Extension].add(301)
this[UnittestProto.repeatedInt64Extension].add(302L)
this[UnittestProto.repeatedUint32Extension].add(303)
this[UnittestProto.repeatedUint64Extension].add(304L)
this[UnittestProto.repeatedSint32Extension].add(305)
this[UnittestProto.repeatedSint64Extension].add(306L)
this[UnittestProto.repeatedFixed32Extension].add(307)
this[UnittestProto.repeatedFixed64Extension].add(308L)
this[UnittestProto.repeatedSfixed32Extension].add(309)
this[UnittestProto.repeatedSfixed64Extension].add(310L)
this[UnittestProto.repeatedFloatExtension].add(311F)
this[UnittestProto.repeatedDoubleExtension].add(312.0)
this[UnittestProto.repeatedBoolExtension].add(false)
this[UnittestProto.repeatedStringExtension].add("315")
this[UnittestProto.repeatedBytesExtension].add(toBytes("316"))
this[UnittestProto.repeatedGroupExtension].add(repeatedGroupExtension { a = 317 })
this[UnittestProto.repeatedNestedMessageExtension]
.add(TestAllTypesKt.nestedMessage { bb = 318 })
this[UnittestProto.repeatedForeignMessageExtension].add(foreignMessage { c = 319 })
this[UnittestProto.repeatedImportMessageExtension]
.add(ImportMessage.newBuilder().setD(320).build())
this[UnittestProto.repeatedLazyMessageExtension]
.add(TestAllTypesKt.nestedMessage { bb = 327 })
this[UnittestProto.repeatedNestedEnumExtension].add(NestedEnum.BAZ)
this[UnittestProto.repeatedForeignEnumExtension].add(ForeignEnum.FOREIGN_BAZ)
this[UnittestProto.repeatedImportEnumExtension].add(ImportEnum.IMPORT_BAZ)
this[UnittestProto.repeatedStringPieceExtension].add("324")
this[UnittestProto.repeatedCordExtension].add("325")
this[UnittestProto.defaultInt32Extension] = 401
this[UnittestProto.defaultInt64Extension] = 402L
this[UnittestProto.defaultUint32Extension] = 403

@ -0,0 +1,340 @@
package com.google.protobuf.kotlin
import com.google.common.truth.Truth.assertThat
import evil_names_proto3.EvilNamesProto3OuterClass.EvilNamesProto3
import evil_names_proto3.EvilNamesProto3OuterClass.HardKeywordsAllTypes
import evil_names_proto3.EvilNamesProto3OuterClass.Class
import evil_names_proto3.HardKeywordsAllTypesKt
import evil_names_proto3.class_
import evil_names_proto3.evilNamesProto3
import evil_names_proto3.hardKeywordsAllTypes
import multiple_files_proto3.MultipleFilesMessageA
import multiple_files_proto3.MultipleFilesMessageB
import multiple_files_proto3.multipleFilesMessageA
import multiple_files_proto3.multipleFilesMessageB
import proto3_unittest.UnittestProto3
import proto3_unittest.TestAllTypesKt
import proto3_unittest.TestAllTypesKt.nestedMessage
import proto3_unittest.UnittestProto3.TestAllTypes
import proto3_unittest.UnittestProto3.TestAllTypes.NestedEnum
import proto3_unittest.UnittestProto3.TestEmptyMessage
import proto3_unittest.copy
import proto3_unittest.testAllTypes
import proto3_unittest.testEmptyMessage
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@RunWith(JUnit4::class)
class Proto3Test {
@Test
fun testGettersAndSetters() {
testAllTypes {
optionalInt32 = 101
assertThat(optionalInt32).isEqualTo(101)
optionalString = "115"
assertThat(optionalString).isEqualTo("115")
optionalNestedMessage = TestAllTypesKt.nestedMessage { bb = 118 }
assertThat(optionalNestedMessage).isEqualTo(TestAllTypesKt.nestedMessage { bb = 118 })
optionalNestedEnum = NestedEnum.BAZ
assertThat(optionalNestedEnum).isEqualTo(NestedEnum.BAZ)
oneofUint32 = 601
assertThat(oneofUint32).isEqualTo(601)
}
}
@Test
fun testRepeatedGettersAndSetters() {
testAllTypes {
repeatedInt32.addAll(listOf(1, 2))
assertThat(repeatedInt32).isEqualTo(listOf(1, 2))
repeatedInt32 += listOf(3, 4)
assertThat(repeatedInt32).isEqualTo(listOf(1, 2, 3, 4))
repeatedInt32[0] = 5
assertThat(repeatedInt32).isEqualTo(listOf(5, 2, 3, 4))
repeatedString.addAll(listOf("1", "2"))
assertThat(repeatedString).isEqualTo(listOf("1", "2"))
repeatedString += listOf("3", "4")
assertThat(repeatedString).isEqualTo(listOf("1", "2", "3", "4"))
repeatedString[0] = "5"
assertThat(repeatedString).isEqualTo(listOf("5", "2", "3", "4"))
repeatedNestedMessage.addAll(listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 }))
assertThat(repeatedNestedMessage).isEqualTo(
listOf(
nestedMessage { bb = 1 },
nestedMessage { bb = 2 }
)
)
repeatedNestedMessage += listOf(nestedMessage { bb = 3 }, nestedMessage { bb = 4 })
assertThat(repeatedNestedMessage).isEqualTo(
listOf(
nestedMessage { bb = 1 },
nestedMessage { bb = 2 },
nestedMessage { bb = 3 },
nestedMessage { bb = 4 }
)
)
repeatedNestedMessage[0] = nestedMessage { bb = 5 }
assertThat(repeatedNestedMessage).isEqualTo(
listOf(
nestedMessage { bb = 5 },
nestedMessage { bb = 2 },
nestedMessage { bb = 3 },
nestedMessage { bb = 4 }
)
)
repeatedNestedEnum.addAll(listOf(NestedEnum.FOO, NestedEnum.BAR))
assertThat(repeatedNestedEnum).isEqualTo(listOf(NestedEnum.FOO, NestedEnum.BAR))
repeatedNestedEnum += listOf(NestedEnum.BAZ, NestedEnum.FOO)
assertThat(repeatedNestedEnum).isEqualTo(
listOf(NestedEnum.FOO, NestedEnum.BAR, NestedEnum.BAZ, NestedEnum.FOO)
)
repeatedNestedEnum[0] = NestedEnum.BAR
assertThat(repeatedNestedEnum).isEqualTo(
listOf(NestedEnum.BAR, NestedEnum.BAR, NestedEnum.BAZ, NestedEnum.FOO)
)
}
}
@Test
fun testClears() {
assertThat(
testAllTypes {
optionalInt32 = 101
clearOptionalInt32()
optionalString = "115"
clearOptionalString()
optionalNestedMessage = TestAllTypesKt.nestedMessage { bb = 118 }
clearOptionalNestedMessage()
optionalNestedEnum = NestedEnum.BAZ
clearOptionalNestedEnum()
oneofUint32 = 601
clearOneofUint32()
}
).isEqualTo(
TestAllTypes.newBuilder().build()
)
}
@Test
fun testCopy() {
val message = testAllTypes {
optionalInt32 = 101
optionalString = "115"
}
val modifiedMessage = message.copy {
optionalInt32 = 201
}
assertThat(message).isEqualTo(
TestAllTypes.newBuilder()
.setOptionalInt32(101)
.setOptionalString("115")
.build()
)
assertThat(modifiedMessage).isEqualTo(
TestAllTypes.newBuilder()
.setOptionalInt32(201)
.setOptionalString("115")
.build()
)
}
@Test
fun testOneof() {
val message = testAllTypes {
oneofString = "foo"
assertThat(oneofFieldCase)
.isEqualTo(TestAllTypes.OneofFieldCase.ONEOF_STRING)
assertThat(oneofString).isEqualTo("foo")
clearOneofField()
assertThat(oneofFieldCase)
.isEqualTo(TestAllTypes.OneofFieldCase.ONEOFFIELD_NOT_SET)
oneofUint32 = 5
}
assertThat(message.getOneofFieldCase())
.isEqualTo(TestAllTypes.OneofFieldCase.ONEOF_UINT32)
assertThat(message.getOneofUint32()).isEqualTo(5)
}
@Test
fun testEmptyMessages() {
assertThat(
testEmptyMessage {}
).isEqualTo(
TestEmptyMessage.newBuilder().build()
)
}
@Test
fun testEvilNames() {
assertThat(
evilNamesProto3 {
initialized = true
hasFoo = true
bar = "foo"
isInitialized = true
fooBar = "foo"
aLLCAPS += "foo"
aLLCAPSMAP[1] = true
hasUnderbarPrecedingNumeric1Foo = true
hasUnderbarPrecedingNumeric42Bar = true
hasUnderbarPrecedingNumeric123Foo42BarBaz = true
extension += "foo"
class_ = "foo"
int = 1.0
long = true
boolean = 1L
sealed = "foo"
interface_ = 1F
in_ = 1
object_ = "foo"
cachedSize_ = "foo"
serializedSize_ = true
value = "foo"
index = 1L
values += "foo"
newValues += "foo"
builder = true
k[1] = 1
v["foo"] = "foo"
key["foo"] = 1
map[1] = "foo"
pairs["foo"] = 1
LeadingUnderscore = "foo"
option = 1
}
).isEqualTo(
EvilNamesProto3.newBuilder()
.setInitialized(true)
.setHasFoo(true)
.setBar("foo")
.setIsInitialized(true)
.setFooBar("foo")
.addALLCAPS("foo")
.putALLCAPSMAP(1, true)
.setHasUnderbarPrecedingNumeric1Foo(true)
.setHasUnderbarPrecedingNumeric42Bar(true)
.setHasUnderbarPrecedingNumeric123Foo42BarBaz(true)
.addExtension("foo")
.setClass_("foo")
.setInt(1.0)
.setLong(true)
.setBoolean(1L)
.setSealed("foo")
.setInterface(1F)
.setIn(1)
.setObject("foo")
.setCachedSize_("foo")
.setSerializedSize_(true)
.setValue("foo")
.setIndex(1L)
.addValues("foo")
.addNewValues("foo")
.setBuilder(true)
.putK(1, 1)
.putV("foo", "foo")
.putKey("foo", 1)
.putMap(1, "foo")
.putPairs("foo", 1)
.setLeadingUnderscore("foo")
.setOption(1)
.build()
)
assertThat(class_ {}).isEqualTo(Class.newBuilder().build())
}
@Test
fun testHardKeywordGettersAndSetters() {
hardKeywordsAllTypes {
as_ = 1
assertThat(as_).isEqualTo(1)
in_ = "foo"
assertThat(in_).isEqualTo("foo")
break_ = HardKeywordsAllTypes.NestedEnum.FOO
assertThat(break_).isEqualTo(HardKeywordsAllTypes.NestedEnum.FOO)
do_ = HardKeywordsAllTypesKt.nestedMessage { while_ = 1 }
assertThat(do_).isEqualTo(HardKeywordsAllTypesKt.nestedMessage { while_ = 1 })
continue_[1] = 1
assertThat(continue_[1]).isEqualTo(1)
else_ += 1
assertThat(else_).isEqualTo(listOf(1))
for_ += "foo"
assertThat(for_).isEqualTo(listOf("foo"))
fun_ += HardKeywordsAllTypes.NestedEnum.FOO
assertThat(fun_).isEqualTo(listOf(HardKeywordsAllTypes.NestedEnum.FOO))
if_ += HardKeywordsAllTypesKt.nestedMessage { while_ = 1 }
assertThat(if_).isEqualTo(listOf(HardKeywordsAllTypesKt.nestedMessage { while_ = 1 }))
}
}
@Test
fun testHardKeywordHazzers() {
hardKeywordsAllTypes {
as_ = 1
assertThat(hasAs_()).isTrue()
in_ = "foo"
assertThat(hasIn_()).isTrue()
break_ = HardKeywordsAllTypes.NestedEnum.FOO
assertThat(hasBreak_()).isTrue()
do_ = HardKeywordsAllTypesKt.nestedMessage { while_ = 1 }
assertThat(hasDo_()).isTrue()
}
}
@Test
fun testHardKeywordClears() {
hardKeywordsAllTypes {
as_ = 1
clearAs_()
assertThat(hasAs_()).isFalse()
in_ = "foo"
clearIn_()
assertThat(hasIn_()).isFalse()
break_ = HardKeywordsAllTypes.NestedEnum.FOO
clearBreak_()
assertThat(hasBreak_()).isFalse()
do_ = HardKeywordsAllTypesKt.nestedMessage { while_ = 1 }
clearDo_()
assertThat(hasDo_()).isFalse()
}
}
@Test
fun testMultipleFiles() {
assertThat(
multipleFilesMessageA {}
).isEqualTo(
MultipleFilesMessageA.newBuilder().build()
)
assertThat(
multipleFilesMessageB {}
).isEqualTo(
MultipleFilesMessageB.newBuilder().build()
)
}
}

@ -1,9 +1,8 @@
// LINT: LEGACY_NAMES
syntax = "proto3";
package protobuf.kotlin.generator;
package evil_names_proto3;
option java_package = "com.google.protobuf.kotlin.generator";
option java_package = "evil_names_proto3";
message EvilNamesProto3 {
bool initialized = 1;

@ -1,8 +1,8 @@
syntax = "proto2";
package protobuf.kotlin.test;
package example_extensible_message;
option java_package = "com.google.protobuf.kotlin.test";
option java_package = "example_extensible_message";
option java_multiple_files = true;
message ExampleExtensibleMessage {

@ -1,8 +1,8 @@
syntax = "proto3";
package protobuf.kotlin.generator;
package multiple_files_proto3;
option java_package = "com.google.protobuf.kotlin.generator";
option java_package = "multiple_files_proto3";
option java_multiple_files = true;
enum NestedEnum { FOO = 0; }

@ -4,6 +4,8 @@
<arg value="--java_out=lite:${generated.testsources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${protobuf.basedir}/java/core/${test.proto.dir}"/>
<arg value="--experimental_allow_proto3_optional"/>
<arg value="${protobuf.source.dir}/google/protobuf/map_lite_unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_import.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_import_lite.proto"/>
@ -20,6 +22,9 @@
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/any_test.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/cached_field_size_test.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/deprecated_file.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/evil_names_proto3.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/example_extensible_message.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/field_presence_test.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/lazy_fields_lite.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/lite_equals_and_hash.proto"/>
@ -29,6 +34,7 @@
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/map_lite_test.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/map_test.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/message_lite_extension_util_test.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/multiple_files_proto3.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/nested_builders_test.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/nested_extension.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/nested_extension_lite.proto"/>
@ -52,7 +58,13 @@
<arg value="--kotlin_out=lite:${generated.testsources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${protobuf.basedir}/java/core/${test.proto.dir}"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/>
<arg value="--experimental_allow_proto3_optional"/>
<arg value="${protobuf.source.dir}/google/protobuf/map_lite_unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_lite.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_proto3.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/evil_names_proto3.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/example_extensible_message.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/multiple_files_proto3.proto"/>
</exec>
</project>

@ -16,6 +16,10 @@
not guarantee API/ABI stability.
</description>
<properties>
<kotlin.version>1.4.31</kotlin.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
@ -37,11 +41,26 @@
<artifactId>guava</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-testlib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk7</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
<build>
@ -179,6 +198,19 @@
<include>Writer.java</include>
</includes>
</resource>
<resource>
<directory>${basedir}/../core/src/main/kotlin/com/google/protobuf</directory>
<includes>
<include>DslList.kt</include>
<include>DslMap.kt</include>
<include>DslProxy.kt</include>
<include>ExtendableMessageLiteExtensions.kt</include>
<include>ExtensionList.kt</include>
<include>OnlyForUseByGeneratedProtoCode.kt</include>
<include>ProtoDslMarker.kt</include>
<include>UnmodifiableCollections.kt</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
@ -238,6 +270,13 @@
<exclude>WireFormatTest.java</exclude>
</excludes>
</resource>
<resource>
<directory>${basedir}/../core/src/test/kotlin/com/google/protobuf</directory>
<excludes>
<exclude>ExtendableMessageExtensionsTest.kt</exclude>
<exclude>Proto2Test.kt</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
@ -326,8 +365,19 @@
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>compile</id>
<goals> <goal>compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${generated.sources.dir}/com/google/protobuf</sourceDir>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals> <goal>test-compile</goal> </goals>

@ -1,8 +1,8 @@
package com.google.protobuf.kotlin
import com.google.common.truth.Truth.assertThat
import com.google.protobuf.kotlin.test.ExampleExtensibleMessage
import com.google.protobuf.kotlin.test.Test as TestProto
import example_extensible_message.ExampleExtensibleMessage
import example_extensible_message.ExampleExtensibleMessageOuterClass as TestProto
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4

@ -16,22 +16,22 @@ import com.google.protobuf.UnittestLite.TestEmptyMessageLite
import com.google.protobuf.UnittestLite.TestEmptyMessageWithExtensionsLite
import com.google.protobuf.copy
import com.google.protobuf.foreignMessageLite
import com.google.protobuf.kotlin.generator.EvilNamesProto2OuterClass.EvilNamesProto2
import com.google.protobuf.kotlin.generator.EvilNamesProto2OuterClass.HardKeywordsAllTypes
import com.google.protobuf.kotlin.generator.EvilNamesProto2OuterClass.Interface
import com.google.protobuf.kotlin.generator.HardKeywordsAllTypesKt
import com.google.protobuf.kotlin.generator.evilNamesProto2
import com.google.protobuf.kotlin.generator.hardKeywordsAllTypes
import com.google.protobuf.kotlin.generator.interface_
import evil_names_proto2.EvilNamesProto2OuterClass.EvilNamesProto2
import evil_names_proto2.EvilNamesProto2OuterClass.HardKeywordsAllTypes
import evil_names_proto2.EvilNamesProto2OuterClass.Interface
import evil_names_proto2.HardKeywordsAllTypesKt
import evil_names_proto2.evilNamesProto2
import evil_names_proto2.hardKeywordsAllTypes
import evil_names_proto2.interface_
import com.google.protobuf.optionalGroupExtensionLite
import com.google.protobuf.repeatedGroupExtensionLite
import com.google.protobuf.testAllExtensionsLite
import com.google.protobuf.testAllTypesLite
import com.google.protobuf.testEmptyMessageLite
import com.google.protobuf.testEmptyMessageWithExtensionsLite
import com.google.protos.proto2_unittest.MapLiteUnittest.MapEnumLite
import com.google.protos.proto2_unittest.MapLiteUnittest.TestMapLite
import com.google.protos.proto2_unittest.testMapLite
import protobuf_unittest.MapLiteUnittest.MapEnumLite
import protobuf_unittest.MapLiteUnittest.TestMapLite
import protobuf_unittest.testMapLite
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@ -452,34 +452,37 @@ class Proto2LiteTest {
this[UnittestLite.repeatedImportEnumExtensionLite].add(ImportEnumLite.IMPORT_LITE_BAR)
this[UnittestLite.repeatedStringPieceExtensionLite].add("224")
this[UnittestLite.repeatedCordExtensionLite].add("225")
this[UnittestLite.repeatedInt32ExtensionLite] += 301
this[UnittestLite.repeatedInt64ExtensionLite] += 302L
this[UnittestLite.repeatedUint32ExtensionLite] += 303
this[UnittestLite.repeatedUint64ExtensionLite] += 304L
this[UnittestLite.repeatedSint32ExtensionLite] += 305
this[UnittestLite.repeatedSint64ExtensionLite] += 306L
this[UnittestLite.repeatedFixed32ExtensionLite] += 307
this[UnittestLite.repeatedFixed64ExtensionLite] += 308L
this[UnittestLite.repeatedSfixed32ExtensionLite] += 309
this[UnittestLite.repeatedSfixed64ExtensionLite] += 310L
this[UnittestLite.repeatedFloatExtensionLite] += 311F
this[UnittestLite.repeatedDoubleExtensionLite] += 312.0
this[UnittestLite.repeatedBoolExtensionLite] += false
this[UnittestLite.repeatedStringExtensionLite] += "315"
this[UnittestLite.repeatedBytesExtensionLite] += toBytes("316")
this[UnittestLite.repeatedGroupExtensionLite] += repeatedGroupExtensionLite { a = 317 }
this[UnittestLite.repeatedNestedMessageExtensionLite] +=
this[UnittestLite.repeatedInt32ExtensionLite].add(301)
this[UnittestLite.repeatedInt64ExtensionLite].add(302L)
this[UnittestLite.repeatedUint32ExtensionLite].add(303)
this[UnittestLite.repeatedUint64ExtensionLite].add(304L)
this[UnittestLite.repeatedSint32ExtensionLite].add(305)
this[UnittestLite.repeatedSint64ExtensionLite].add(306L)
this[UnittestLite.repeatedFixed32ExtensionLite].add(307)
this[UnittestLite.repeatedFixed64ExtensionLite].add(308L)
this[UnittestLite.repeatedSfixed32ExtensionLite].add(309)
this[UnittestLite.repeatedSfixed64ExtensionLite].add(310L)
this[UnittestLite.repeatedFloatExtensionLite].add(311F)
this[UnittestLite.repeatedDoubleExtensionLite].add(312.0)
this[UnittestLite.repeatedBoolExtensionLite].add(false)
this[UnittestLite.repeatedStringExtensionLite].add("315")
this[UnittestLite.repeatedBytesExtensionLite].add(toBytes("316"))
this[UnittestLite.repeatedGroupExtensionLite].add(repeatedGroupExtensionLite { a = 317 })
this[UnittestLite.repeatedNestedMessageExtensionLite].add(
TestAllTypesLiteKt.nestedMessage { bb = 318 }
this[UnittestLite.repeatedForeignMessageExtensionLite] += foreignMessageLite { c = 319 }
this[UnittestLite.repeatedImportMessageExtensionLite] +=
)
this[UnittestLite.repeatedForeignMessageExtensionLite].add(foreignMessageLite { c = 319 })
this[UnittestLite.repeatedImportMessageExtensionLite].add(
ImportMessageLite.newBuilder().setD(320).build()
this[UnittestLite.repeatedLazyMessageExtensionLite] +=
)
this[UnittestLite.repeatedLazyMessageExtensionLite].add(
TestAllTypesLiteKt.nestedMessage { bb = 327 }
this[UnittestLite.repeatedNestedEnumExtensionLite] += NestedEnum.BAZ
this[UnittestLite.repeatedForeignEnumExtensionLite] += ForeignEnumLite.FOREIGN_LITE_BAZ
this[UnittestLite.repeatedImportEnumExtensionLite] += ImportEnumLite.IMPORT_LITE_BAZ
this[UnittestLite.repeatedStringPieceExtensionLite] += "324"
this[UnittestLite.repeatedCordExtensionLite] += "325"
)
this[UnittestLite.repeatedNestedEnumExtensionLite].add(NestedEnum.BAZ)
this[UnittestLite.repeatedForeignEnumExtensionLite].add(ForeignEnumLite.FOREIGN_LITE_BAZ)
this[UnittestLite.repeatedImportEnumExtensionLite].add(ImportEnumLite.IMPORT_LITE_BAZ)
this[UnittestLite.repeatedStringPieceExtensionLite].add("324")
this[UnittestLite.repeatedCordExtensionLite].add("325")
this[UnittestLite.defaultInt32ExtensionLite] = 401
this[UnittestLite.defaultInt64ExtensionLite] = 402L
this[UnittestLite.defaultUint32ExtensionLite] = 403
@ -539,14 +542,14 @@ class Proto2LiteTest {
testAllExtensionsLite {
this[UnittestLite.repeatedInt32ExtensionLite].addAll(listOf(1, 2))
assertThat(this[UnittestLite.repeatedInt32ExtensionLite]).isEqualTo(listOf(1, 2))
this[UnittestLite.repeatedInt32ExtensionLite] += listOf(3, 4)
this[UnittestLite.repeatedInt32ExtensionLite].addAll(listOf(3, 4))
assertThat(this[UnittestLite.repeatedInt32ExtensionLite]).isEqualTo(listOf(1, 2, 3, 4))
this[UnittestLite.repeatedInt32ExtensionLite][0] = 5
assertThat(this[UnittestLite.repeatedInt32ExtensionLite]).isEqualTo(listOf(5, 2, 3, 4))
this[UnittestLite.repeatedStringExtensionLite].addAll(listOf("1", "2"))
assertThat(this[UnittestLite.repeatedStringExtensionLite]).isEqualTo(listOf("1", "2"))
this[UnittestLite.repeatedStringExtensionLite] += listOf("3", "4")
this[UnittestLite.repeatedStringExtensionLite].addAll(listOf("3", "4"))
assertThat(this[UnittestLite.repeatedStringExtensionLite])
.isEqualTo(listOf("1", "2", "3", "4"))
this[UnittestLite.repeatedStringExtensionLite][0] = "5"
@ -565,11 +568,12 @@ class Proto2LiteTest {
repeatedGroupExtensionLite { a = 2 }
)
)
this[UnittestLite.repeatedGroupExtensionLite] +=
this[UnittestLite.repeatedGroupExtensionLite].addAll(
listOf(
repeatedGroupExtensionLite { a = 3 },
repeatedGroupExtensionLite { a = 4 }
)
)
assertThat(this[UnittestLite.repeatedGroupExtensionLite]).isEqualTo(
listOf(
repeatedGroupExtensionLite { a = 1 },
@ -594,8 +598,9 @@ class Proto2LiteTest {
assertThat(this[UnittestLite.repeatedNestedMessageExtensionLite]).isEqualTo(
listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 })
)
this[UnittestLite.repeatedNestedMessageExtensionLite] +=
this[UnittestLite.repeatedNestedMessageExtensionLite].addAll(
listOf(nestedMessage { bb = 3 }, nestedMessage { bb = 4 })
)
assertThat(this[UnittestLite.repeatedNestedMessageExtensionLite]).isEqualTo(
listOf(
nestedMessage { bb = 1 },
@ -618,7 +623,7 @@ class Proto2LiteTest {
.addAll(listOf(NestedEnum.FOO, NestedEnum.BAR))
assertThat(this[UnittestLite.repeatedNestedEnumExtensionLite])
.isEqualTo(listOf(NestedEnum.FOO, NestedEnum.BAR))
this[UnittestLite.repeatedNestedEnumExtensionLite] += listOf(NestedEnum.BAZ, NestedEnum.FOO)
this[UnittestLite.repeatedNestedEnumExtensionLite].addAll(listOf(NestedEnum.BAZ, NestedEnum.FOO))
assertThat(this[UnittestLite.repeatedNestedEnumExtensionLite]).isEqualTo(
listOf(NestedEnum.FOO, NestedEnum.BAR, NestedEnum.BAZ, NestedEnum.FOO)
)

Loading…
Cancel
Save