[JS IR BE] Generate fileds for all properties

This commit is contained in:
Svyatoslav Kuzmich
2019-04-05 17:15:44 +03:00
parent 14ec30dd5a
commit 7796d084e1
2 changed files with 3 additions and 2 deletions
@@ -30,6 +30,7 @@ class PropertiesLowering(
private val context: BackendContext,
private val originOfSyntheticMethodForAnnotations: IrDeclarationOrigin? = null,
private val skipExternalProperties: Boolean = false,
private val generateAnnotationFields: Boolean = false,
private val computeSyntheticMethodName: ((Name) -> String)? = null
) : IrElementTransformerVoid(), FileLoweringPass {
override fun lower(irFile: IrFile) {
@@ -53,7 +54,7 @@ class PropertiesLowering(
if (skipExternalProperties && declaration.isEffectivelyExternal()) listOf(declaration) else {
ArrayList<IrDeclaration>(4).apply {
// JvmFields in a companion object refer to companion's owners and should not be generated within companion.
if (kind != ClassKind.ANNOTATION_CLASS && declaration.backingField?.parent == declaration.parent) {
if (generateAnnotationFields || (kind != ClassKind.ANNOTATION_CLASS && declaration.backingField?.parent == declaration.parent)) {
addIfNotNull(declaration.backingField)
}
addIfNotNull(declaration.getter)