-
Notifications
You must be signed in to change notification settings - Fork 565
[prework] Add types to struct initialize #1024
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
Merged
azdavis
merged 14 commits into
master
from
azdavis/add-types-to-struct-initialize-prework
Jun 24, 2019
Merged
[prework] Add types to struct initialize #1024
azdavis
merged 14 commits into
master
from
azdavis/add-types-to-struct-initialize-prework
Jun 24, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It is ENFORCEd that if ret == SOME(x) then x != []. This is in preparation for allowing ChalkODMProp::replaceDSL to return something other than the vector<unique_ptr<ast::Expression>>. Previously, because the only thing we were returning was that vector, we could use the empty vector to signify "no desugaring occurred".
The old comment seemed to be inaccurate in multiple places. This attempts to make it more accurate. Of course, it's likely that the old comment was probably accurate at one point and became inaccurate over time as the code changed. The same could happen to this new comment. And since the inaccuracy of the old comment wasn't noticed until now, it's arguable that we could remove the comment altogether and not lose much.
jez
reviewed
Jun 24, 2019
jez
reviewed
Jun 24, 2019
jez
reviewed
Jun 24, 2019
jez
approved these changes
Jun 24, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments, other than those, looks good.
Thanks for breaking this out!
This was referenced Jun 24, 2019
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is pre-work for #986, which was getting to be big. @DarkDimius requested that the work which doesn't change the observable behavior of the statics be pulled out into pre-work. When this is merged, #986 will be rebased on top of it.
Things changed:
if !cond then ... else ...
std::vector
with empty meaning "no value", return anstd::optional
withstd::nullopt
meaning "no value" andENFORCE
that if the optional contains a vector, that vector is not emptyNodesAndProp
(but don't put anything inProp
yet, that's for later)T
helper to be more conciseMotivation
To prepare for #986.
Test plan
No changes to behavior. No tests.