Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
SemanticStrengh
on May 11, 2022
|
parent
|
context
|
favorite
| on:
Flutter 3
no the feature you're looking for is sealed classes, see e.g. Kotlin. Rust enum variants cannot be externally defined classes
the_duke
on May 11, 2022
[–]
That's completely orthogonal to ADT vs enum.
SemanticStrengh
on May 11, 2022
|
parent
[–]
Enums enable two things: check current type from union of types and exhaustivity check in switch
The former is solved by reflection, the latter by sealed classes.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: