Avoid creating result temp for is-expressions (follow-up)#72273
Avoid creating result temp for is-expressions (follow-up)#72273AlekseyTs merged 13 commits intodotnet:mainfrom
Conversation
|
@alrz How was the first commit in this PR created? |
Could you please instead replace it with revert of revert of the original merged PR? I am referring to #68694 and to #69582 that followed. |
Done. Let me know if the rest should be squashed if you intend to keep the revert in the merge. |
Thanks!
No. We will squash while merging this PR |
|
Sure, thought you wanted to do that separately. btw I made the rebase branch to rebase the rest of commits but ended up using |
AlekseyTs
left a comment
There was a problem hiding this comment.
LGTM (commit 9), assuming CI is passing
|
@jcouv, @dotnet/roslyn-compiler For the second review. |
|
@jcouv, @dotnet/roslyn-compiler For the second review. |
| EmitCondExpr(sequence.Value, sense: sense); | ||
| } | ||
| else | ||
| { |
There was a problem hiding this comment.
Can we assert that sense == true in this branch?
There was a problem hiding this comment.
Added an assertion to the same effect.
There was a problem hiding this comment.
We can get into the alternative branch with !used and a boolean type. The added assertion doesn't cover sense in that scenario.
jcouv
left a comment
There was a problem hiding this comment.
Done with review pass (iteration 9). Only one minor question/suggestion
jcouv
left a comment
There was a problem hiding this comment.
Done with review pass (iteration 12). Still just a nit on assertion
|
@alrz Thanks for the contribution |
This reverts commit 00c20fc.
…dotnet#72827) This reverts commit 00c20fc.
* upstream/main: (416 commits) Semantic search (dotnet#71268) Make more static Fix MEF import of IExternalCSharpCopilotCodeAnalysisService to allow null Make static Make private Add comments Add method name to TimeInQueue telemetry (dotnet#72841) switch to frozen Simplify Add test Downstream Use singular helper when creating checksumsw Use singular helper when creating checksumsw Remove ability for a project to change its language Revert "Avoid creating result temp for is-expressions (dotnet#72273)" (dotnet#72827) Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2420199 Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2420199 Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2420199 Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2420199 Improve generic type argument list error recovery (dotnet#69734) ...

Follow-up to #68694 including a possible fix for #69615 at 9ed6e9d.
In the repro, I traced the difference between iterating over
List<T>andImmutableArray<T>where the former works correctly and the enumerator is captured in a field. ForList<T>the loop is wrapped in a try-finally where the state is modified afterwards. Looking back at the VisitLoweredIsPatternExpression I noticed this could be a possible missing piece.Closes #59615
Closes #55334