[Mono.Debugger.Soft] Implement IsGenericType/Method for protocol < 2.12
[mono.git] / mcs / mcs / lambda.cs
index c73a54a10e89d08133d2d5148b456e19f02e3bb2..f1cc07b195866435cc084e0af900a215caa3d28c 100644 (file)
@@ -7,6 +7,7 @@
 // Dual licensed under the terms of the MIT X11 or GNU GPL
 //
 // Copyright 2007-2008 Novell, Inc
+// Copyright 2011 Xamarin Inc
 //
 
 #if STATIC
@@ -23,13 +24,8 @@ namespace Mono.CSharp {
                //    A list of Parameters (explicitly typed parameters)
                //    An ImplicitLambdaParameter
                //
-               public LambdaExpression (bool isAsync, Location loc)
-                       : base (isAsync, loc)
-               {
-               }
-
                public LambdaExpression (Location loc)
-                       : this (false, loc)
+                       : base (loc)
                {
                }
 
@@ -128,6 +124,11 @@ namespace Mono.CSharp {
                {
                        return "lambda expression";
                }
+               
+               public override object Accept (StructuralVisitor visitor)
+               {
+                       return visitor.Visit (this);
+               }
        }
 
        class LambdaMethod : AnonymousMethodBody
@@ -194,7 +195,11 @@ namespace Mono.CSharp {
                {
                        if (statement != null) {
                                statement.EmitStatement (ec);
-                               ec.Emit (OpCodes.Ret);
+                               if (unwind_protect)
+                                       ec.Emit (OpCodes.Leave, ec.CreateReturnLabel ());
+                               else {
+                                       ec.Emit (OpCodes.Ret);
+                               }
                                return;
                        }