https://bugzilla.novell.com/show_bug.cgi?id=656918
https://bugzilla.novell.com/show_bug.cgi?id=656918#c2 Jb Evain <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Sys.Core |C# Version|2.6.x |SVN AssignedTo|[email protected] |[email protected] Product|Mono: Class Libraries |Mono: Compilers --- Comment #2 from Jb Evain <[email protected]> 2010-12-14 11:48:22 UTC --- This is actually a compiler issue. Test case to be compiled with dmcs: <<<<<<<<<<<<<<<<<< using System; using System.Linq.Expressions; using System.Reflection; class Foo { public void OnBaz (IBaz baz) { } } interface IBar { void RunOnBaz (Action<IBaz> action); } interface IBaz { } class Program { static void Main () { var foo = new Foo (); Test (bar => bar.RunOnBaz (foo.OnBaz)); } static void Test (Expression<Action<IBar>> expression) { var flags = BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; Console.WriteLine ( typeof (Expression).GetProperty ("DebugView", flags).GetValue (expression, null)); } } <<<<<<<<<<<<<<<<<< dmcs seems to pass a null constant argument to the this parameter of CreateDelegate. The binary produced by csc works on .net and on Mono: <<<<<<<<<<<<<<<<<< Lambda #Lambda1<System.Action`1[IBar]>(IBar $bar) { .Call $bar.RunOnBaz((System.Action`1[IBaz]).Call System.Delegate.CreateDelegate( .Constant<System.Type>(System.Action`1[IBaz]), Constant<Program+<>c__DisplayClass0>(Program+<>c__DisplayClass0).foo, .Constant<System.Reflection.MethodInfo>(Void OnBaz(IBaz)))) } <<<<<<<<<<<<<<<<<< The binary produced by dmcs doesn't work, neither on .net, nor on Mono: <<<<<<<<<<<<<<<<<< Lambda #Lambda1<System.Action`1[IBar]>(IBar $bar) { .Call $bar.RunOnBaz((System.Action`1[IBaz]).Call System.Delegate.CreateDelegate( .Constant<System.Type>(System.Action`1[IBaz]), null, .Constant<System.Reflection.MethodInfo>(Void OnBaz(IBaz)))) } <<<<<<<<<<<<<<<<<< -- 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
