[Mono-bugs] [Bug 65854][Maj] New - CodeDom does not correctly generate array of arrays type references

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 13 Sep 2004 11:54:35 -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 lluis@ximian.com.

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

--- shadow/65854	2004-09-13 11:54:35.000000000 -0400
+++ shadow/65854.tmp.659	2004-09-13 11:54:35.000000000 -0400
@@ -0,0 +1,54 @@
+Bug#: 65854
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lluis@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: CodeDom does not correctly generate array of arrays type references
+
+When creating a type reference such as:
+
+new CodeTypeReference ("System.String[][]");
+
+the c# generator generates string[] instead of string[][]. This is a
+regression, it used to work.
+
+Full test case:
+
+using System;
+using System.CodeDom;
+using System.CodeDom.Compiler;
+using Microsoft.CSharp;
+
+public class Test
+{
+	public static void Main ()
+	{
+		CodeNamespace codeNamespace = new CodeNamespace("hola");
+		CodeCompileUnit codeUnit = new CodeCompileUnit();
+		codeUnit.Namespaces.Add (codeNamespace);
+		
+		CodeDomProvider provider = new CSharpCodeProvider();
+		ICodeGenerator generator = provider.CreateGenerator();
+		CodeGeneratorOptions options = new CodeGeneratorOptions();
+		
+		CodeTypeDeclaration cc = new CodeTypeDeclaration ("Una");
+		codeNamespace.Types.Add (cc);
+		
+		CodeMemberMethod cm = new CodeMemberMethod ();
+		cm.Name ="un";
+		cm.ReturnType = new CodeTypeReference ("System.String[][]");
+		cc.Members.Add (cm);
+		
+		generator.GenerateCodeFromCompileUnit(codeUnit, Console.Out, options);
+	}
+}