-
Notifications
You must be signed in to change notification settings - Fork 4.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
Fix reversed output in interpolation concatenation #55494
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.
Don't use a reverse on the parts arrays, reverse the builder after populating.
@333fred The builder is indeed reversed at the end of the method, but that wasn't enough (we were appending each part in-order, then reversing the final result - but we want to append each part reversed, then reverse the final result). For the code to be reversing a builder instead of array, I'd have to create a new builder for each Alternatively, attempt to rewrite the code such that we don't need reversing at all (ie, walk from left to right - but I'm not sure how hard is that or if that's possible). |
Left to right isn't feasible. If we need to add these in reverse order here as well, we should not use linq to do so. |
I'm also concerned about flow analysis. Make sure we have a test like |
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_BinaryOperator.cs
Outdated
Show resolved
Hide resolved
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.
@jcouv ptal.
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.
LGTM Thanks (iteration 4)
Looks like there is a legitimate failure: |
Thanks @Youssef1313 |
Fixes #55493
Fixes #55461
Relates to feature/test plan: #51499