Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sealed interface structure bug #43

Closed
kramlex opened this issue Apr 7, 2022 · 0 comments · Fixed by #65
Closed

sealed interface structure bug #43

kramlex opened this issue Apr 7, 2022 · 0 comments · Fixed by #65
Labels
bug Something isn't working
Milestone

Comments

@kramlex
Copy link

kramlex commented Apr 7, 2022

Bug

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")
    }
  }
}
@Alex009 Alex009 added the bug Something isn't working label Apr 7, 2022
@Alex009 Alex009 added this to the 0.6.1 milestone Oct 28, 2022
@Alex009 Alex009 mentioned this issue Oct 28, 2022
@Alex009 Alex009 closed this as completed Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants