-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Unit representaiton from {}
to undefined
#267
Change Unit representaiton from {}
to undefined
#267
Conversation
I think the docs probably ought to be changed, but that requires us to make a decision on the question I posed on the issue (in short: is the runtime representation of Unit part of the public API or not). In the meantime I think this can go in. |
This means you won’t be able to tell if a field in a record with type unit field is present or not, surely? |
It's still possible to tell -
|
@garyb Could you explain the compiler check and where specifically we'd need to look? |
I've just had another look myself. Pretty sure the compiler-generated code is all good, the only compiler-generated code for records that I can think of is constructing records, and modifying fields in records. When modifying fields of open records it does use I also did a search for references to undefined, and as far as I could see we're just inserting or erasing undefineds directly from the AST, never making equality comparisons with them. |
When I searched for |
Oh, interesting. Yes and no... that |
Can I get an approval, so I can merge this? Seems like all issues have been addressed. |
Thanks! |
Description of the change
Fixes #266. Did we want to change the wording for the docs at all? Perhaps just say "don't return a value at all" instead?
Checklist: