Bug 370414

Summary: Missing CS0136
Product: [Mono] Mono: Compilers Reporter: Jonathan Pobst <jpobst>
Component: C#Assignee: Marek Safar <msafar>
Status: RESOLVED FIXED QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None CC: harinath, joncham
Version: 1.9   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Test Case

Description Jonathan Pobst 2008-03-13 15:18:44 UTC
Created attachment 201298 [details]
Test Case

The attached code should produce a CS0136:

A local variable named 'i' cannot be declared in this scope because it would give a different meaning to 'i', which is already used in a 'parent or current/child' scope to denote something else

Both mcs and gmcs compile without error.

This case is derived from trying to compile MonoDevelop with csc:
CSharpTextEditorExtension.cs: Line 358, Variables lin, col
Comment 1 Jonathan Pobst 2008-03-13 15:20:02 UTC
Bleh, ignore the struct stuff in the test case.  It is dead code from a previous test case.  Sorry.
Comment 2 Michael Hutchinson 2008-03-19 21:57:41 UTC
Fixed the issue in MD.
Comment 3 Raja Harinath 2008-03-31 06:17:13 UTC
blargh...

We need to fix a ton of subtle issues with our 'switch' implementation.  This is basically due to us treating each 'case' as a separate block, while the semantics of C# require us to treat the whole switch statement as a single block.

Thanks for the testcase.


*** This bug has been marked as a duplicate of bug 314500 ***
Comment 4 Raja Harinath 2008-03-31 06:17:48 UTC
oops
Comment 6 Susanne Oberhauser-Hirschoff 2011-07-20 12:29:47 UTC
Reassigning to Miguel to drive further resolution...
Comment 7 Marek Safar 2012-02-03 13:07:50 UTC
*** Bug 478101 has been marked as a duplicate of this bug. ***
Comment 8 Marek Safar 2012-02-03 17:02:02 UTC
Fixed in master