The compiler should allow the return of a span declared and initialized by switch expression. #44588
Labels
Area-Compilers
Bug
New Language Feature - Pattern Matching
Pattern Matching
New Language Feature - Ref Locals and Returns
Ref Locals and Returns
Milestone
Version Used:
.netcoreapp3.1
VS 16.6.0
Steps to Reproduce:
Expected Behavior:
The compiler should allow the returning of the span in the method GetSpan3().
Actual Behavior:
The compiler complains that the return statement "may expose referenced variables outside of their declaration scope."
The text was updated successfully, but these errors were encountered: