sealed interface FeedListUnit
data class AddPostUnit(
val onClick: () -> Unit
): FeedListUnit
data class FeedUnit(
val dateTimeString: StringDesc,
val postText: String,
val likesCount: Int,
val dislikeCount: Int,
val feedReaction: FeedReaction,
val likeClick: () -> Unit,
val dislikeClick: () -> Unit
): FeedListUnit
compile to
public enum FeedListUnitKs {
case ru/app/mobile/shared/feed/presentation/feed/AddPostUnit(AddPostUnit)
case ru/app/mobile/shared/feed/presentation/feed/FeedUnit(FeedUnit)
public init(_ obj: FeedListUnit) {
if let obj = obj as? shared.AddPostUnit {
self = .ru/app/mobile/shared/feed/presentation/feed/AddPostUnit(obj)
} else if let obj = obj as? shared.FeedUnit {
self = .ru/app/mobile/shared/feed/presentation/feed/FeedUnit(obj)
} else {
fatalError("FeedListUnitKs not syncronized with FeedListUnit class")
}
}
}
Bug
compile to