Bug 318444 (MONO75460) - [GMCS] missing method in interface types
Summary: [GMCS] missing method in interface types
Status: RESOLVED FIXED
Alias: MONO75460
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-04 16:57 UTC by Michal Moskal
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:24:15 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".