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

Equatable enums treated as complex enums #108

Closed
angelolloqui opened this issue Mar 21, 2020 · 1 comment
Closed

Equatable enums treated as complex enums #108

angelolloqui opened this issue Mar 21, 2020 · 1 comment
Labels

Comments

@angelolloqui
Copy link
Owner

This code:

private enum Planet: Equatable {
    case mercury, venus, earth
    case mars, jupiter, saturn, uranus, neptune
}

Should be transpiled to:

private enum class Planet {
    mercury,
    venus,
    earth,
    mars,
    jupiter,
    saturn,
    uranus,
    neptune
}
```

But it is currently:

```
private enum class Planet (val rawValue: Equatable) {
    mercury(0), venus(1), earth(2), mars(3), jupiter(4), saturn(5), uranus(6), neptune(7);

    companion object {
        operator fun invoke(rawValue: Equatable) = Planet.values().firstOrNull { it.rawValue == rawValue }
    }
}
```

angelolloqui added a commit that referenced this issue Mar 21, 2020
@angelolloqui
Copy link
Owner Author

Fixed with #109

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