Bugzilla – Bug 318444
[GMCS] missing method in interface types
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by malekith@pld-linux.org 2005-07-04 09:57:34 MST ---- Description of Problem: The following sample: interface IFoo {} class Bar : IFoo {} class Cont<T> { T f; public Cont(T x) { f = x; } public override string ToString () { return f.ToString (); } } class M { public static void Main () { Cont<IFoo> c = new Cont<IFoo> (new Bar ()); System.Console.WriteLine (c); } } when compiled with gmcs and run gives ** (bug.exe:7024): WARNING **: Missing method ToString in assembly /home/users/malekith/nemerle/ncc/testsuite/bug.exe token a000003 Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object in <0x00000> <unknown method> in <0x00023> System.IO.TextWriter:Write (System.Object value) in <0x00022> System.IO.TextWriter:Write (System.Object value) in <0x00020> System.IO.TextWriter:WriteLine (System.Object value) in <0x0003d> System.IO.SynchronizedWriter:WriteLine (System.Object value) in <0x00028> System.Console:WriteLine (System.Object value) in <0x00048> M:Main () It should run without a problem though. Additionaly gmcs during compilation prints a bogus warning: bug.cs(5) warning CS0169: The private field 'Cont`1.f' is never used This is however runtime issue, Nemerle generated code also fails like this. ---- Additional Comments From martin@ximian.com 2005-07-11 12:25:55 MST ---- Fixed in SVN. Unknown operating system unknown. Setting to default OS "Other".