Bug 478101 - Missing error CS0136 for same variable in switch statement cases
Summary: Missing error CS0136 for same variable in switch statement cases
Status: RESOLVED DUPLICATE of bug 370414
Alias: None
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: SVN
Hardware: Other Other
: P5 - None : Normal
Target Milestone: ---
Assignee: Marek Safar
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-20 14:33 UTC by Jonathan Chambers
Modified: 2012-02-03 13:07 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Testcase (273 bytes, text/plain)
2009-02-20 14:33 UTC, Jonathan Chambers
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***