https://bugzilla.novell.com/show_bug.cgi?id=691061
https://bugzilla.novell.com/show_bug.cgi?id=691061#c0 Summary: mcs fails to report CS0201 for lambda for void return delegate & parenthesized expression Classification: Mono Product: Mono: Compilers Version: SVN Platform: Other OS/Version: openSUSE 11.4 Status: NEW Severity: Minor Priority: P5 - None Component: C# AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- The following example shows that the lambda expression that takes a delegate whose return value is void fails to reject parenthesized expression: $ cat x.cs using System; public class X { static Action<int> x; public static void Main () { string s = null; x = i => (s = "ABCDE".Substring (0, i)); x (3); Console.WriteLine (s); } } atsushi@monkeytimeline2 ~/tests $ mcs x.cs atsushi@monkeytimeline2 ~/tests $ csc x.cs Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1 Copyright (C) Microsoft Corporation. All rights reserved. x.cs(10,12): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement If it is not Action but Func (i.e. with some return value) .NET also does not reject such a parenthesized expression. I'm not sure which behavior is conformant to ECMA C# specification. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
