New flag in proto

This commit is contained in:
Mikhael Bogdanov
2020-02-05 15:34:37 +01:00
committed by Mikhail Bogdanov
parent 0c0bd67a6b
commit ff8eac29a0
8 changed files with 86 additions and 11 deletions
@@ -82,11 +82,17 @@ class JvmSerializerExtension @JvmOverloads constructor(
if (moduleName != JvmProtoBufUtil.DEFAULT_MODULE_NAME) {
proto.setExtension(JvmProtoBuf.classModuleName, stringTable.getStringIndex(moduleName))
}
//TODO: local delegated properties
val containerAsmType =
if (DescriptorUtils.isInterface(descriptor)) typeMapper.mapDefaultImpls(descriptor) else typeMapper.mapClass(descriptor)
writeLocalProperties(proto, containerAsmType, JvmProtoBuf.classLocalVariable)
writeVersionRequirementForJvmDefaultIfNeeded(descriptor, proto, versionRequirementTable)
if ((jvmDefaultMode == JvmDefaultMode.ALL_INCOMPATIBLE || jvmDefaultMode == JvmDefaultMode.ALL_COMPATIBILITY) &&
isInterface(descriptor)
) {
proto.setExtension(JvmProtoBuf.generationOptions, JvmFlags.getPropertyFlags(true))
}
}
// Interfaces which have @JvmDefault members somewhere in the hierarchy need the compiler 1.2.40+