Can I make generated Swift protocol properties cov...
# kotlin-native
a
Can I make generated Swift protocol properties covariant? My case: Kotlin:
Copy code
interface Article {
    val id: Int
    val category: Category
}

interface Category {
    val id: Int
}
Swift:
Copy code
@objc
class RealmArticle: Object, KNArticle {
    @objc dynamic var id: Int32 = 0
    @objc dynamic var category: RealmCategory = RealmCategory() // type does not conform to protocol KNArticle
}

@objc
class RealmCategory: Object, KNCategory {
    @objc dynamic var id: Int32 = 0
}
s
@objc dynamic var category: RealmCategory = RealmCategory() // type does not conform to protocol KNArticle
This limitation is imposed by Swift, not Kotlin. How do you suggest to change generated
KNArticle
protocol to support covariant overriding in Swift?