Fix reversed output in interpolation concatenation#55494
Conversation
333fred
left a comment
There was a problem hiding this comment.
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
|
Looks like there is a legitimate failure: |
|
Thanks @Youssef1313 |
Fixes #55493
Fixes #55461
Relates to feature/test plan: #51499