remove HiddenParameters, refactor declareThis#10042
Conversation
|
Thanks for your pull request and interest in making D better, @thewilsonator! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#10042" |
8306104 to
c0ab4c5
Compare
|
Wasn't this added in the recent fix so two this pointers could be used? Was that all unnecessary, or were insufficient test cases added? |
|
Some stuff was added to it with that, but git blame says: #9179 |
|
For reference this PR is part of me trying to get to the bottom of why closure's contexts are not typed (and type checked) properly. |
|
|
|
I think it's a bit difficult to follow the refactoring in this PR. What is better with this change? In general I think it's better to have as few methods as possible that modify their parameters or the receiver. The previous version returned the result. |
... and then immediately assigned to those members.
line count change for one. |
Yes. I still think it’s better. I’ve been trying to use DMD as a library now for a while and it’s a pain in the ass that the compiler changes things inline all over the place. It would be much better if one method was responsible for one thing and didn’t modify values in place. |
ibuclaw
left a comment
There was a problem hiding this comment.
Pretty sure that this can just be internal to the frontend.
1661c9b to
0049f4a
Compare
|
I have no problem with this if you think it's ready for inclusion. |
| v.storage_class |= STC.parameter | STC.nodtor; | ||
| if (type.ty == Tfunction) | ||
| Type tthis = addModStc(isThis2 ? | ||
| Type.tvoidptr.sarrayOf(2).pointerTo() : |
There was a problem hiding this comment.
Note to self, this type could be cached somewhere for easy comparison in the backend where void*[2]* can be replaced with a two field struct with the actual context types as its fields.
Also qualify the
void* __capturecontext parameter.@ibuclaw is that used anywhere in GDC? looks like it could be removed from the headers.