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:
Alexander Udalov
2015-10-15 18:38:49 +03:00
parent 4a361ebe60
commit f62128bdcd
4 changed files with 32 additions and 25 deletions
@@ -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)
}