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

Enums with inheritance not working #53

Closed
angelolloqui opened this issue Dec 1, 2017 · 1 comment
Closed

Enums with inheritance not working #53

angelolloqui opened this issue Dec 1, 2017 · 1 comment
Labels

Comments

@angelolloqui
Copy link
Owner

This swift enum:

public enum AnemoneException: Error {
    case notFound
    case network(HttpResponse, Error?)
}

Can be translated to a sealed class. However, the current version does not work because of the inheritance clause. Removing the inheritance translates to:

public sealed class AnemoneException {
    object notFound : AnemoneException()
    data class network(val v1: HttpResponse, val v2: Error?) : AnemoneException()
}
@angelolloqui
Copy link
Owner Author

Fixed with 27d019d

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

No branches or pull requests

1 participant