[Mono-list] (no subject)
   
    kojo
     
    kojoadams@hotmail.com
       
    Wed, 4 Sep 2002 22:10:27 -0400
    
    
  
This is a multi-part message in MIME format.
------=_NextPart_000_01DE_01C2545F.DFBEE090
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
    I don't know if this is expected behaviour or a bug.
The following code does not compile with mcs but works fine with csc
     =20
> using System.Xml.Serialization;
    public class SerializableClass
    {=20
        [XmlAttribute( Type=3Dtypeof(MyEntry) )]
        public Entry myEntry;
    }
    public class Entry{}
    public class MyEntry : Entry{}
It fails with the error CS0182: An attribute argument must be a constant =
expression, typeof expression or array creation expression.
kojo
------=_NextPart_000_01DE_01C2545F.DFBEE090
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2719.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>    I don't know if this =
is expected=20
behaviour or a bug.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The following code does not compile =
with mcs but=20
works fine with csc</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>      </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>> using =
System.Xml.Serialization;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>    public class=20
SerializableClass</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>    { </FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>       =20
[XmlAttribute( Type=3Dtypeof(MyEntry) )]</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>        public=20
Entry myEntry;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>    }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>    public class=20
Entry{}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>    public class MyEntry =
:=20
Entry{}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>It fails with the error CS0182: An =
attribute=20
argument must be a constant expression, typeof expression or array =
creation=20
expression.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>kojo</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_01DE_01C2545F.DFBEE090--