[Mono-bugs] [Bug 77589][Nor] New - SerializationCodeGenerator generates invalid code for jagged byte array

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Feb 18 06:35:19 EST 2006


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 gert.driesen at pandora.be.

http://bugzilla.ximian.com/show_bug.cgi?id=77589

--- shadow/77589	2006-02-18 06:35:19.000000000 -0500
+++ shadow/77589.tmp.16431	2006-02-18 06:35:19.000000000 -0500
@@ -0,0 +1,64 @@
+Bug#: 77589
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: lluis at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: SerializationCodeGenerator generates invalid code for jagged byte array
+
+SerializationCodeGenerator generates invalid code for a jagged byte array 
+which has been assigned an XmlAttribute with DataType "base64Binary".
+
+To reproduce, compile the following code snippet:
+
+using System;
+using System.Collections;
+using System.Xml.Serialization;
+
+public class EntryPoint
+{
+  static void Main ()
+  {
+    XmlReflectionImporter importer = new XmlReflectionImporter ();
+    XmlTypeMapping map = importer.ImportTypeMapping (typeof (ArrayType));
+    XmlSerializer xs = new XmlSerializer (map);
+    xs.Serialize (Console.Out, new ArrayType ());
+  }
+}
+
+public class ArrayType
+{
+  [XmlAttribute (DataType = "base64Binary")]
+  public byte[][] bin1 = new byte[][] { new byte[] { 1, 2 }, new byte[] { 
+1, 2 } };
+}
+
+and run it:
+
+$ export MONO_XMLSERIALIZER_THS=0
+$ mono test.exe
+
+Actual result:
+
+Error while compiling generated serializer
+/tmp/xxxxx.cs : warning CS0642: Possible mistaken empty statement
+/tmp/xxxxx.cs : error CS1526: A new expression requires () or [] after 
+type
+<?xml version="1.0" encoding="iso-8859-1"?>
+<ArrayType xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bin1="AQI= AQI=" />
+
+Expected result:
+
+<ArrayType xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bin1="AQI= AQI=" />


More information about the mono-bugs mailing list