Restrict extension setter and getter operations to non-nullable T
diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt
index d1f04a8..10630a9 100644
--- a/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt
+++ b/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt
@@ -7,7 +7,7 @@
operator fun <
M : GeneratedMessageV3.ExtendableMessage<M>,
B : GeneratedMessageV3.ExtendableBuilder<M, B>,
- T
+ T : Any
> B.set(extension: ExtensionLite<M, T>, value: T) {
setExtension(extension, value)
}
@@ -16,7 +16,7 @@
operator fun <
M : GeneratedMessageV3.ExtendableMessage<M>,
MorBT : GeneratedMessageV3.ExtendableMessageOrBuilder<M>,
- T
+ T : Any
> MorBT.get(extension: ExtensionLite<M, T>): T = getExtension(extension)
/** Returns true if the specified extension is set on this builder. */
diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageLiteExtensions.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageLiteExtensions.kt
index 8bd8ed3..dd1dc87 100644
--- a/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageLiteExtensions.kt
+++ b/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageLiteExtensions.kt
@@ -7,14 +7,14 @@
operator fun <
M : GeneratedMessageLite.ExtendableMessage<M, *>,
MOrBT : GeneratedMessageLite.ExtendableMessageOrBuilder<M, *>,
- T
+ T : Any
> 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
+ T : Any
> B.set(extension: ExtensionLite<M, T>, value: T) {
setExtension(extension, value)
}