Actually I found it and produced a very simple testcase - turned out I needed to include at least one class that *implemented* the interface as well as the one that declared it. I've attached the files but I can also include them here in their entirety:

InnerInterface.cs:

public class Outer {
  public interface Inner {
  }
}

Impl.cs:

public class Impl : Outer.Inner {
}


Compiling these files in the order given, with "mcs InnerInterface.cs Impl.cs", works fine.


Compiling them in the opposite order, with "mcs Impl.cs InnerInterface.cs", gives the error.

Incidentally, if "Inner" is a class rather than an interface, a similar bug manifests. You don't get a crash, but you get an erroneous claim that the class definition of Inner is circular. Again, this only happens if "Impl.cs" is specified first on the commandline.

The fact that the Class case is caught by a circularity handler, but the Interface case is not, suggests to my untrained eye that there may also be a problem in catching circularity problems with interfaces. I haven't attempted to verify that, because I don't have sufficient depth of understanding to be sure that I'm creating a circularity in the right form that it would be caught by the same codepath, but it might be worth looking into why the behavior of Classes versus Interfaces differs in this way.

Stuart.


-- Stuart Ballard, Senior Web Developer NetReach, Inc. (215) 283-2300, ext. 126 http://www.netreach.com/
public class Impl : Outer.Inner {
}
public class Outer {
  public interface Inner {
  }
}

Reply via email to