Ref assignment to ref ternary silently falls back to non-ref assignment #75023
Labels
Area-Compilers
Bug
New Language Feature - Ref Locals and Returns
Ref Locals and Returns
untriaged
Issues and PRs which have not yet been triaged by a lead
Version Used: cbe141c
Steps to Reproduce:
SharpLab
Expected Behavior:
Emitted equivalently to
Or perhaps an error like
Actual Behavior:
Emitted like non-
ref
assignment(b ? ref x : ref y) = z
.Notes:
When emitting with a Debug roslyn build, this assert fails:
roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_AssignmentOperator.cs
Line 258 in bd5c00e
Search keywords: ref conditional operator.
This issue is referenced in code (via #74498).
The text was updated successfully, but these errors were encountered: