[Mono-list] Error while casting a struct to an interface
Dwivedi , Ajay Kumar
Mon, 1 Jul 2002 12:39:55 +0100
> I got a compiler error telling that I cannot convert a struct to an
> interface through casting. The struct actually implements the
> and I try to cast it directly (although the 'as' way doesn't work
> ISomeInterface isObject = (ISomeInterface) isObject;
This is surely a bug in the Compiler. The interface implementation
information is not written to the output file for structs.
public struct Mystruct: IMyInterface
public interface IMyInterface
The monodis of output file has
.class public sequential ansi sealed beforefieldinit Mystruct
whereas it should also have
Please file a bug report.