https://bugzilla.novell.com/show_bug.cgi?id=671552
https://bugzilla.novell.com/show_bug.cgi?id=671552#c0 Summary: dmcs generates invalid code from generics/iterator/anon methods code Classification: Mono 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: --- Blocker: --- Testcase: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< using System; using System.Linq; using System.Collections; using System.Collections.Generic; public static class IEnumerableTransform { public static IEnumerable<TOut> Transform<TOut> (this IEnumerable<int> input, EmitterFunc<TOut> rule) { foreach (var v in input) { TOut output; rule (out output); yield return output; } } public static EmitterFunc<TOut> Emit<TOut> (TOut result) { return delegate (out TOut output) { output = result; }; } public delegate void EmitterFunc<TOut> (out TOut output); public static void Main () { IEnumerable<int> arr = new int [10]; Console.WriteLine (arr.Transform<char> (IEnumerableTransform.Emit<char> ('t')).ToArray ()); } } >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> When running the code compiled by dmcs, both the mono and the MS runtime crash, mono --verify reports: Unhandled Exception: System.BadImageFormatException: Error verifying IEnumerableTransform/<Emit>c__AnonStorey1`1:<>m__0 (TOut&): Invalid generic type (!!!!0) (argument out of range or method is not generic) at 0x0007 This happens with both HEAD and 2.10. -- 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
