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

Do note that record types aren't closed even with a private constructor. The compiler will generate a protected constructor for copy operations which can then be inherited from. To prevent this, you have to define your own protected constructor and have it throw a runtime exception if it isn't a valid case.


You are technically correct (the best kind of correct), but in practice I've not found this to be a problem, certainly not something that is ofsetting the vast usefulness of this data pattern.


I've found the same to be true as well.




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

Search: