Hacker Read
top
|
best
|
new
|
newcomments
|
leaders
|
about
|
bookmarklet
login
htns | karma 253 | avg karma 1.06
2020-03-12 17:35:16+00:00
|
next
[–]
update item
That's equivalent to wrapping an enum in a class. Emulations of type hierarchies without OO often fail like this, having a A-or-B be literally the same type so losing out on type safety/forcing constant rechecking of the discriminant.
reply
view as:
tree
latest_first
afiori | karma 3210 | avg karma 1.28
2020-03-13 09:06:56+00:00
|
next
[–]
similar comments
That can be done in Rust by having two different types implement the same interface
reply
Legal
|
privacy
reply