Search Issue Tracker
Won't Fix
Votes
0
Found in
2017.4.0f1
2017.4.11f1
2018.3.0a1
2019.1.0a1
2019.2.0a1
Issue ID
1131564
Regression
No
Visual Studio debugger reports variables with same name in Coroutine as null
How to reproduce:
1. Open the attached project ("case_1131564-VisualStudioDebuggerIncorrectNull.zip")
2. Open the "TestScript" and start debugging it
3. Set a breakpoint in TestIEnumerator() and check the values of variables "g" and "mc"
Expected result: "g" correctly shows its value as Game Object "first node" and "mc" shows its value as "MeshCollider"
Actual result: "g" and "mc" values are returned as null
Reproduced in: 2019.2.0a6, 2019.1.0b5, 2018.3.7f1, 2017.4.22f1
Note: only reproduces if there's a "yield return null" statement in the 2nd block-scope and the two variables in different scopes have the same name
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on memcpy when using ScreenCapture.CaptureScreenshot with superSize set to zero
- [URP] Package Samples - Missing scripts in Unity 2022+
- [URP][Package Samples] Continuous "Renderer at index _ is missing for camera _" warnings when opening sample scene
- [URP] Package Samples - Missing scripts in Unity 6
- [URP] Package samples - scenes using FirstPersonController not working in Unity 6
Resolution Note:
This is only an issue when using the old scripting runtime, likely due to a bug in the Mono C# compiler. The legacy scripting runtime has been deprecated at 2018.3 and is being removed for 2019.2. Please use the new scripting runtime which uses the Roslyn C# compiler to avoid this issue.