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 [EMAIL PROTECTED]

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

--- shadow/79474        2006-09-22 14:13:56.000000000 -0400
+++ shadow/79474.tmp.31984      2006-09-22 14:13:56.000000000 -0400
@@ -0,0 +1,82 @@
+Bug#: 79474
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: Ubuntu dapper
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: XSD
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: xsd generates classes that derive from sealed class
+
+Description of Problem:
+
+If a complexType extends a type that restricts string, xsd will generate ,
+it can happen that the generated class.
+
+Steps to reproduce the problem:
+1. Create file bug.xsd:
+<?xml version="1.0" encoding="UTF-8"?>
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema";
+targetNamespace="http://example.com/ns"; xmlns:ns="http://example.com/ns";
+elementFormDefault="qualified" attributeFormDefault="unqualified">
+       <simpleType name="string30">
+
+               <restriction base="string">
+
+                       <maxLength value="30"/>
+
+               </restriction>
+
+       </simpleType>
+       <element name="element">
+               <complexType>
+                       <simpleContent>
+
+                               <extension base="ns:string30">
+
+                                       <attribute name="attribute" 
type="string"/>
+
+                               </extension>
+
+                       </simpleContent>
+               </complexType>
+       </element>
+
+</schema>
+
+2. run xsd:
+xsd bug.xsd /classes
+
+3. compile the generated classes:
+mcs /t:library bug.cs
+
+Actual Results:
+&#65279;bug.cs(19,18): error CS0509: `Schemas.element': cannot derive from 
sealed
+class `string'
+/usr/lib/mono/1.0/mscorlib.dll: `string', name of symbol related to
+previous error
+&#65279;Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+
+How often does this happen? 
+Always
+
+Additional Information:
+xsd should generate a Value field, like when the type extends string directly:
+<extension base="string">
+gives:
+[System.Xml.Serialization.XmlText()]
+public string Value;
+
+There might be other ways to extend string indirectly that could trigger
+this bug, but I'm no xsd guru.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to