Search Issue Tracker

Fixed in 2021.2.X

Votes

0

Found in

2020.2

2020.2.0f1

2021.1

2021.2

Issue ID

1303638

Regression

No

error CS8352 when trying to return a copy of a ref struct due to an outdated build of Roslyn

Scripting

-

How to reproduce:
1. Open the attached project "RoslynCompilerBug.zip"
2. See the Console window

Expected result: No errors
Actual result: error CS8352: Cannot use local 'value' in this context because it may expose referenced variables outside of their declaration scope

Reproducible with - 2020.2.3f1, 2021.1.0a3, 2021.2.0b3
Could not test (scripting errors) - 2018.4, 2019.4

  1. Resolution Note (fix version 2021.2):

    Fixed in 2021.2.0a6

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.