-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ctype nitpicks #10211
Ctype nitpicks #10211
Conversation
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.
I reviewed the patch out of curiosity, it looks correct. I'm not sure what was the issue with the comment removed in the second commit, but I'm happy to trust you on that. See inline comment.
(I believe that @garrigue and @t6s may want to formulate an opinion on this change, so I won't merge right away.)
I believe (but again, I might have misread (several times)) that the comment states the exact opposite of what the code does/what the line below enforces. |
I hadn't looked at the code following the comment in detail, my remark meant "I haven't reviewed this part". Now I have and I agree with you. |
bb1b4f0
to
4c93c5d
Compare
(I changed my mind about "not merging right away", I think it's good to go.) |
This looks fine to me too. By the way, the reason we still have two ways to undo the marking is that one can only use backtracking when newly created types do not survive the traversal. Otherwise, any action on this new type that was logged would be undone too (and tracking what is logged and what isn't is error prone). |
The first commit (around
generalize_structure
) is just some trivial clean up that could/should have happened years ago when the surrounding code and interface changed.The second commit removes a comment that was introduced in #9994 which is incorrect, and for which I already left a note in the PR. That comment was also, in my opinion, not really useful: it doesn't bring extra information, everything it says is obvious from the code, and it doesn't explain the motivations behind the code (not that it would be necessary in this particular case).
The next two commits are also follow ups to #9994, but I thought I'd just propose the changes instead of leaving more comments on that PR. The basic idea is that before that PR the code in
check_scope_escape
was using the exact same marking-through-levels code as the rest ofCtype
, but the PR broke that regularity for no good reason. I think what happened is that the pattern was abstracted in that PR, and since that particular use of it didn't quite fit the template, then it got its own ad-hoc code.So I extended a bit the template, and I think the result is neat.