https://bugzilla.novell.com/show_bug.cgi?id=662108
https://bugzilla.novell.com/show_bug.cgi?id=662108#c0 Summary: mcs emits invalid IL on as operator for nullable types 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: --- marek, The following C#: using System; class T { public static string Convert (int a) { return Convert (a as int?); } public static string Convert (int? a) { return null; } } for the T:Convert(int) method emits: .method public static hidebysig default string Convert (int32 a) cil managed { // Method begins at RVA 0x20f4 // Code size 17 (0x11) .maxstack 8 IL_0000: ldarg.0 IL_0001: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::'.ctor'(!0) IL_0006: unbox.any valuetype [mscorlib]System.Nullable`1<int32> IL_000b: call string class T::Convert(valuetype [mscorlib]System.Nullable`1<int32>) IL_0010: ret } // end of method T::Convert The unbox.any is invalid, csc doesn't emit it (altho it does a local store, but I presume thats for the debugger). This affects monotouch as well, so any chance of a fix on 2.6 as well as master/2.8? Thanks -- 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
