[Mono-list] Error while casting a struct to an interface
Jaime Anguiano Olarra
jaime@geneura.ugr.es
01 Jul 2002 13:36:31 +0200
--=-ADNqbEr00s1Q+nuDQG7f
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable
Thanks Ajay!,
I'm sending a file report with code to test it right now.
Jaime.
El lun, 01-07-2002 a las 13:39, Dwivedi , Ajay Kumar escribi=F3:
> > I got a compiler error telling that I cannot convert a struct to an
> > interface through casting. The struct actually implements the=20
> > interface
> > and I try to cast it directly (although the 'as' way doesn't work
> > neither):=20
> >=20
> > ISomeInterface isObject =3D (ISomeInterface) isObject;
> >=20
> This is surely a bug in the Compiler. The interface implementation
> information is not written to the output file for structs.
>=20
> For example,
> public struct Mystruct: IMyInterface
> {
> }
> public interface IMyInterface
> {
> }
>=20
> The monodis of output file has
> .class public sequential ansi sealed beforefieldinit Mystruct
> extends [mscorlib]System.ValueType
>=20
> whereas it should also have
>=20
> implements IMyInterface
>=20
> Please file a bug report.
>=20
> Cheers,
> Ajay
>=20
--=20
// http://geneura.ugr.es -- The Geneura Team
// http://www.go-mono.com -- The Mono Project
--=-ADNqbEr00s1Q+nuDQG7f
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Esta parte del mensaje esta firmada digitalmente
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQA9ID6/0ZuGtECkr6cRAm3xAJ9NutYa4LNQQVC4g432r2uvR4miwgCgxYys
InatGvbAbfV24buPF/Mp+tU=
=S6+U
-----END PGP SIGNATURE-----
--=-ADNqbEr00s1Q+nuDQG7f--