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

Generic class inside sealed class not generated properly #86

Open
radimjanda754 opened this issue Jul 18, 2023 · 0 comments
Open

Generic class inside sealed class not generated properly #86

radimjanda754 opened this issue Jul 18, 2023 · 0 comments

Comments

@radimjanda754
Copy link

Following code

sealed class ResourceState<out R> {

    data class Success<out T>(val data: T) : ResourceState<T>()
    data class Error(val throwable: Throwable) : ResourceState<Nothing>()
    object Loading : ResourceState<Nothing>()
    object Empty : ResourceState<Nothing>()

}

Generates generic class type T like this

public enum ResourceStateKs<R : AnyObject> {

  case empty
  case error(ResourceStateError)
  case loading
  case success(ResourceStateSuccess<T>)
  ...

Which says Cannot find type 'T' in scope.

I guess it should've been something like this

public enum ResourceStateKs<R : AnyObject, T: AnyObject> {

  case empty
  case error(ResourceStateError)
  case loading
  case success(ResourceStateSuccess<T>)
  ...

Is it possible to fix this and generate properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant