Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
c-cube
· 3y ago · 0 comments
When I looked at it a few years ago, the compiler didn't prevent you from accessing fields from the wrong variant, and didn't provide exhaustivity checks. So I think it still falls short of this (excellent) litmus test :/
Comments
[–]
elcritch
3y ago
They've improved the compiler analysis for them significantly, including exhaustivity checks and field checks.
[–]
cobby
3y ago
Also Nim requires you to use unique field names across all variants.
[–]
alwaysbeconsing
3y ago
This annoying restriction is lifted in Nim 2; see the linked announcement.
[–]
xigoi
3y ago
Where in the announcement does it say that?
[–]
ElegantBeef
3y ago
They likely read "overloadable enums" and went "Oh Rust calls their tagged unions enums" so assumed all languages did.