Search Issue Tracker
Fixed in 5.5.0
Votes
0
Found in
5.4.3f1
Issue ID
860956
Regression
Yes
Unable to declare local variable within different scope
Steps to reproduce:
1. Open the attached project (860956-TestCase.zip)
2. Open the Assets/test.unity scene
3. Error message appears in Console Window:
Assets/Test.cs(30,24): error CS0136: A local variable named `heal' cannot be declared in this scope because it would give a different meaning to `heal', which is already used in a `child' scope to denote something else
Expected result: The code should be compiled without error
Actual result: Compiler gives an error
Reproduced with: 5.5.0a1, 5.5.0f3, 5.5.0p1, 5.6.0b1
Not reproduced with: 5.3.6p8, 5.4.3p3
Regression introduced in 5.5.0a4
-------------------------------------------
Answer from Dev team: The error reported by the compiler is actually correct. The code does not compile with the .Net C# compiler either. The old compiler was more lax, and allowed this incorrect usage through.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Any small change in UI Builder Inspector refreshes Editor Inspector
- Inaccurate Box Collider boundaries on a rotated child Cube when the parent GameObject Scale is non-uniform
- [Android] "SHADOWS_SCREEN" set as shader Keyword when no "_ShadowMapTexture" is bound leads to freeze on a build on some Mali GPU devices
- The global scene list is overridden in a project built with command line when the Override Global Scene List setting is disabled in the build profile
- Global Scenes are not included in the Build when building multiple Build Profiles at the same time
Add comment