Bug 478101

Summary: Missing error CS0136 for same variable in switch statement cases
Product: [Mono] Mono: Compilers Reporter: Jonathan Chambers <joncham>
Component: C#Assignee: Marek Safar <msafar>
Status: RESOLVED DUPLICATE QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None    
Version: SVN   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Testcase

Description Jonathan Chambers 2009-02-20 14:33:36 UTC
Created attachment 274298 [details]
Testcase

Description of Problem:
gmcs does not give an error on the attached test case while csc does.

Steps to reproduce the problem:
1. Try and compile attached test.cs: gmcs test.cs
2. 


Actual Results:
Successful compile

Expected Results:
test.cs(18,8): error CS0136: A local variable named 'a' cannot be declared in this scope because it would give a different meaning to 'a', which is already used in a 'child' scope to denote something else

How often does this happen? 
Everytime

Additional Information:
Comment 1 Jonathan Chambers 2009-02-20 14:34:38 UTC
FYI, I found this bug when trying to compile the debugger on Windows. So, once this is fixed the debugger will have compile errors.
Comment 2 Jonathan Chambers 2010-06-11 20:09:58 UTC
This causes problems building System.dll with csc. I get the following error with CSC that is not present with the mono compiler (r158840).

  System.Security.Cryptography.X509Certificates\X509Certificate2Collection.cs(223,12): error CS0136: A local variable named 'msg' cannot be declared in this scope because it would give a different meaning to 'msg', which is already used in a 'child' scope to denote something else
Comment 4 Susanne Oberhauser-Hirschoff 2011-07-20 12:30:08 UTC
Reassigning to Miguel to drive further resolution...
Comment 5 Marek Safar 2012-02-03 13:07:49 UTC
Duplicate

*** This bug has been marked as a duplicate of bug 370414 ***