[Mono-bugs] [Bug 659528] New: goto case won't work in lambda

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Dec 14 22:53:59 EST 2010



           Summary: goto case won't work in lambda
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.8.x
          Platform: x86-64
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: C#
        AssignedTo: msafar at novell.com
        ReportedBy: p.bludov at wi2geo.ru
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

Description of Problem:

Steps to reproduce the problem:
1. Compile this snippet

using System;

namespace MonoTest
    public static class GotoCase
        public static void Call(Action<UriKind> func)

        static void Main()
            Call(x =>
                switch (x)
                    case UriKind.Absolute :
                        goto case UriKind.Relative;
                    case UriKind.Relative :

Actual Results:
Compiler error: test.cs(19,49): error CS0159: The label `case 2:' could not be
found within the scope of the goto statement

Expected Results:
Compilation succeeded

How often does this happen? 
Every time

Additional Information:
Refactoring the lambda into a named method solves the problem.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list