Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was pretty surprised, how the heck are unions different from enums?

I read that they're essentially the same as C unions (~untagged enums), but I have no clue how `match` works in that case.



A pattern on a union just interprets it as the specified field. It doesn't try to determine which one was actually written to last.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: