Bugzilla – Bug 318176
[GMCS] miscompiles 'is' statement
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by vargaz@gmail.com 2005-06-04 13:21:20 MST ---- Testcase: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< using System; using System.Reflection; public class Tests { public void GetName (MethodBase method, out object retType) { retType = method is ConstructorInfo ? new Object () : new Object (); } public static void Main () { object o; new Tests ().GetName (typeof (Tests).GetMethod ("Main"), out o); } } <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< When compiling this with gmcs, it prints: uj.cs(7) warning CS0184: The given expression is never of the provided ('System.Nullable`1') type also, the generated IL looks doesn't contain an isinst instruction at all: .maxstack 8 IL_0000: ldarg.2 IL_0001: br IL_0010 IL_0006: newobj instance void object::.ctor() IL_000b: br IL_0015 IL_0010: newobj instance void object::.ctor() IL_0015: stind.ref IL_0016: ret ---- Additional Comments From martin@ximian.com 2005-06-08 12:01:14 MST ---- Fixed in SVN. ---- Additional Comments From miguel@ximian.com 2005-06-08 14:37:40 MST ---- close bug This bug blocked bug(s) 75153. Unknown operating system unknown. Setting to default OS "Other".