[Mono-list] NullException with mcs compiled code that has complex inheritance from interfaces --> mcs bug?

Dominik Fretz lists@roboto.ch
Wed, 14 May 2003 17:02:54 +0200

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


Working on the task to get #D running on mono I encounterd a problem 
with the complex inheritance of interfaces.

I have two interfaces and two abstract classes.

ICommand is the base interface
ISubCommand inherit's from ICommand

Abstract Classes:
AbstractCommand inherits from ICommand
AbstractSubCommand inherit's from AbstractCommand and from ISubCommand

TestCommand inherits from AbstractSubCommand
So TestCommand iherits 2 times from ICommand, once over 
AbstractSubCommand->ISubCommand->ICommand and once over 

If i now create a instance foo of TestCommand:
TestCommand foo = new TestCommand();

and then call:

there is a exception.
This only happens if I compile this with mcs.
A exe from windows/.net works on mono.

Find attached a demo source for this problem.

I also submited a bug (#42973) on this issue.

I currently work with mono/mcs from CVS (from 13. May 2003).

Hope someone can find and fix this.



Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

  using System;

  namespace ConsoleApplication
    public interface ICommand {
      void Run();

    public interface ISubCommand : ICommand {}

    public abstract class AbstractCommand : ICommand {
      public abstract void Run();

    public abstract class AbstractSubCommand : AbstractCommand, ISubCommand {}

    public class TestCommand : AbstractSubCommand {
      public override void Run() {
        Console.WriteLine("Hello from: TestCommand");

	  class Class1
		  static void Main(string[] args) {
        TestCommand foo =  new TestCommand();