-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Preincrement improvements #3472
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
Preincrement improvements #3472
Conversation
d511e76 to
f72319e
Compare
|
Hi @siegfriedpammer, I'm running into a small problem with this pull request. My tests pass, except for Roslyn 1.3, which compiles the pre-increment like this: I want to write a separate transform to make the IL into this: In other words, I want the second transform to switch the position of My current pattern matching would work on this final transformed IL. However, I'm concerned about unintended consequences and unsure of how this should be implemented. In particular:
In regards to rules, my idea was:
What are your thoughts? |
|
I think your order-swapping only makes sense if you can guarantee that it'll be combined into a preincrement. So I think this doesn't make sense as a separate statement-swapping transform, but should be a transform that directly creates the inline assignment. |
|
But if it only impacts Roslyn 1.3, then maybe we don't need to support preincrements for that particular version? |
0a992a6 to
20d93e2
Compare
I ended up doing this. I'll come back and implement a second pull request if I discover that 1.3 support is necessary for my use case. |
|
@ds5678 so it is no longer WIP (PR title)? |
|
Fixed |
20d93e2 to
2c80dc9
Compare
2c80dc9 to
f860777
Compare
Problem
#3468