https://bugzilla.novell.com/show_bug.cgi?id=659536
https://bugzilla.novell.com/show_bug.cgi?id=659536#c0 Summary: The compiler fails to infer lambda array type 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: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- Description of Problem: Steps to reproduce the problem: Compile this snippet: using System; using System.Linq.Expressions; namespace MonoTest { public static class InferArrayType { public static void foo(Func<Expression,bool>[] args) { } public static void bar(Action<Expression> seq, Func<Expression,bool> action) { foo(new [] { p => { seq(p); return true; }, action }); // cannot convert `object' expression to type `Func<Expression,bool>[]' } } } Actual Results: Compilation fails with test.cs(14,25): error CS1503: Argument `#1' cannot convert `object' expression to type `System.Func<System.Linq.Expressions.Expression,bool>[]' Expected Results: Compilation suceeded Additional Information: As a workaround, the type must be specified explicitly: public static void bar(Action<Expression> seq, Func<Expression,bool> action) { foo(new Func<Expression,bool>[] { p => { seq(p); return true; }, action }); } -- 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
