SwiftKotlin icon indicating copy to clipboard operation
SwiftKotlin copied to clipboard

Static constants not properly mapped to Companion objects

Open angelolloqui opened this issue 7 years ago • 0 comments

This Swift:

public struct VoucherCampaign {
    public static let inviteFriendsId = VoucherCampaignId("INVITE_FRIENDS")
}

Translates to:

public data class VoucherCampaign(
public val inviteFriendsId = VoucherCampaignId("INVITE_FRIENDS")
) {}

But should have a companion object with the static constant:

public data class VoucherCampaign {
    object Companion {
        val inviteFriendsId = VoucherCampaignId("INVITE_FRIENDS")
    }
}

angelolloqui avatar Nov 06 '17 15:11 angelolloqui