https://bugzilla.novell.com/show_bug.cgi?id=392448
Summary: gmcs issue with lambda expression passed as delegates
Product: Mono: Compilers
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
Repro:
--
using System;
using System.Collections;
class Test {
public static IList Foo (Action<IList> action)
{
ArrayList l = new ArrayList ();
action (l);
return l;
}
public static IList Populator (IList list, IEnumerable items)
{
foreach (object item in items)
list.Add (item);
return list;
}
public static void Main (string [] args)
{
var list = Foo (l => Populator (l, args));
foreach (object item in list)
Console.WriteLine (item);
}
}
--
Fails with:
[mono] ~/Desktop @ gmcs test.cs
test.cs(22,28): error CS1502: The best overloaded method match for
`Test.Foo(System.Action<System.Collections.IList>)' has some invalid arguments
test.cs(5,29): (Location of the symbol related to previous error)
test.cs(22,28): error CS1503: Argument 1: Cannot convert type `lambda
expression' to `System.Action<System.Collections.IList>'
test.cs(24,17): error CS1579: foreach statement cannot operate on variables of
type `object' because it does not contain a definition for `GetEnumerator' or
is not accessible
That should compile and print to stdout all arguments passed to the executable.
--
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