[Mono-bugs] [Bug 75460][Nor] New - [GMCS] missing method in interface types

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jul 4 09:57:34 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by malekith at pld-linux.org.

http://bugzilla.ximian.com/show_bug.cgi?id=75460

--- shadow/75460	2005-07-04 09:57:34.000000000 -0400
+++ shadow/75460.tmp.23763	2005-07-04 09:57:34.000000000 -0400
@@ -0,0 +1,64 @@
+Bug#: 75460
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: malekith at pld-linux.org               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] missing method in interface types
+
+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.


More information about the mono-bugs mailing list