[Mono-bugs] [Bug 42779][Nor] New - Type.IsSerializable should be true for any kind of arrays
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Sun, 11 May 2003 23:46:38 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by jean-marc.andre@polymtl.ca.
http://bugzilla.ximian.com/show_bug.cgi?id=42779
--- shadow/42779 Sun May 11 23:46:37 2003
+++ shadow/42779.tmp.20370 Sun May 11 23:46:37 2003
@@ -0,0 +1,97 @@
+Bug#: 42779
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: jean-marc.andre@polymtl.ca
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Type.IsSerializable should be true for any kind of arrays
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+I think that Type.IsSerializable should be "true" for any kind of arrays.
+Even if the array items are not serializable.
+
+
+Steps to reproduce the problem:
+1.
+
+using System;
+using System.Reflection;
+using System.Runtime.Serialization;
+
+public class NotSerializableClass: ISerializable {
+ public void GetObjectData(SerializationInfo info, StreamingContext
+conte
+xt) {
+ }
+
+}
+
+public class MyClass {
+
+ public static void Main() {
+
+ try{
+
+
+
+ Console.WriteLine("Type {0} is serialisable: {1}",
+typeo
+f(Int32[]), typeof(Int32[]).IsSerializable);
+ Console.WriteLine("Type {0} is serialisable: {1}",
+typeo
+f(String[]), typeof(String[]).IsSerializable);
+ Console.WriteLine("Type {0} is serialisable: {1}",
+typeo
+f(System.Xml.XmlText), typeof(System.Xml.XmlText).IsSerializable);
+ Console.WriteLine("Type {0} is serialisable: {1}",
+typeo
+f(System.Xml.XmlText[]), typeof(System.Xml.XmlText[]).IsSerializable);
+ Console.WriteLine("Type {0} is serialisable: {1}",
+typeo
+f(NotSerializableClass), typeof(NotSerializableClass).IsSerializable);
+ Console.WriteLine("Type {0} is serialisable: {1}",
+typeo
+f(NotSerializableClass[]), typeof(NotSerializableClass[]).IsSerializable);
+ }
+ catch(SerializationException e){
+ Console.WriteLine(e.Message);
+ }
+
+ }
+}
+2.
+3.
+
+Actual Results:
+Type System.Int32[] is serialisable: False
+Type System.String[] is serialisable: False
+Type System.Xml.XmlText is serialisable: False
+Type System.Xml.XmlText[] is serialisable: False
+Type NotSerializableClass is serialisable: False
+Type NotSerializableClass[] is serialisable: False
+
+Expected Results:
+Type System.Int32[] is serialisable: True
+Type System.String[] is serialisable: True
+Type System.Xml.XmlText is serialisable: False
+Type System.Xml.XmlText[] is serialisable: True
+Type NotSerializableClass is serialisable: False
+Type NotSerializableClass[] is serialisable: True
+
+How often does this happen?
+always
+
+Additional Information: