[Mono-bugs] [Bug 77588][Nor] New - [PATCH]
SerializationCodeGenerator generates invalid code for Array
with no default public ctor
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sat Feb 18 05:45:52 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=77588
--- shadow/77588 2006-02-18 05:45:52.000000000 -0500
+++ shadow/77588.tmp.15731 2006-02-18 05:45:52.000000000 -0500
@@ -0,0 +1,56 @@
+Bug#: 77588
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com
+ReportedBy: gert.driesen at pandora.be
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: [PATCH] SerializationCodeGenerator generates invalid code for Array with no default public ctor
+
+(System.Xml.Serialization.)SerializationCodeGenerator generates invalid
+code for an Array (schema) type.
+
+This is an example of the code generated by SerializationCodeGenerator:
+
+public MyList ReadObject_ArrayOfAnyType (bool isNullable, bool checkType)
+{
+ throw CreateReadOnlyCollectionException ("MyList");
+ return ;
+}
+
+The "return" statement should've been omitted here.
+
+I'll attach a patch and a small repro.
+
+Make sure you don't forgot to set MONO_XMLSERIALIZER_THS to 0 before
+running the test assembly:
+
+$ mcs test.cs
+$ export MONO_XMLSERIALIZER_THS=0
+$ mono test.exe
+
+Actual result:
+
+Generating /tmp/xxxxx.cs
+Error while compiling generate serializer
+/tmp/xxxxx.cs(58,4) : warning CS0642: Possible mistaken empty statement
+/tmp/xxxxx.cs(86,4) : warning CS0642: Possible mistaken empty statement
+/tmp/xxxxx.cs(24,4) : warning CS0642: Unreachable code detected
+/tmp/xxxxx.cs(24,4) : error CS0126: An object of a type convertible
+to 'MyList' is required for the return statement
+<ArrayOfAnyType xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
+
+Expected result:
+
+<ArrayOfAnyType xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
More information about the mono-bugs
mailing list