// Authors: Miguel de Icaza (miguel@gnu.org)
// Marek Safar (marek.safar@gmail.com)
//
-// Licensed under the terms of the GNU GPL
+// Dual licensed under the terms of the MIT X11 or GNU GPL
//
-// (C) 2007 Novell, Inc
+// Copyright 2007-2008 Novell, Inc
//
using System;
return "lambda expression";
}
}
+
+ public override Expression CreateExpressionTree (EmitContext ec)
+ {
+ return Block.CreateExpressionTree (ec);
+ }
}
//
base.Emit (ec);
}
- public override bool Resolve (EmitContext ec)
+ protected override bool DoResolve (EmitContext ec)
{
//
// When delegate returns void, only expression statements can be used
if (Expr == null)
return false;
- if (Expr is ExpressionStatement && (Expr is Assign || TypeManager.IsEqual (Expr.Type, ec.ReturnType)))
+ if (Expr is ExpressionStatement) {
+ if (Expr is Invocation)
+ return TypeManager.IsEqual (Expr.Type, TypeManager.void_type);
return true;
+ }
Expr.Error_InvalidExpressionStatement ();
return false;
}
- return base.Resolve (ec);
+ return base.DoResolve (ec);
}
}
}