Fix protobuf extension API usages
"getExtension" returns default value when the requested extension is not present, which is 0 for Int, which makes no sense for extensions like methodImplClassName that are storing the number in the string table
This commit is contained in:
+1
@@ -79,6 +79,7 @@ class KotlinJavascriptAnnotationAndConstantLoader(
|
||||
proto: ProtoBuf.Property,
|
||||
expectedType: JetType
|
||||
): ConstantValue<*>? {
|
||||
if (!proto.hasExtension(JsProtoBuf.compileTimeValue)) return null
|
||||
val value = proto.getExtension(JsProtoBuf.compileTimeValue)
|
||||
return deserializer.resolveValue(expectedType, value, container.nameResolver)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user