[Mono-bugs] [Bug 75190][Nor] New - CodeDOM:
GenerateCodeFromCompileUnit generates no code for
CodeSnippetCompileUnit
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Jun 9 02:26:27 EDT 2005
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=75190
--- shadow/75190 2005-06-09 02:26:27.000000000 -0400
+++ shadow/75190.tmp.9800 2005-06-09 02:26:27.000000000 -0400
@@ -0,0 +1,64 @@
+Bug#: 75190
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: gert.driesen at pandora.be
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: CodeDOM: GenerateCodeFromCompileUnit generates no code for CodeSnippetCompileUnit
+
+Mono's CodeGenerator.GenerateCodeFromCompileUnit is broken when the
+compile unit is an instance of CodeSnippetCompileUnit. In that case a
+header without source code is generated.
+
+To reproduce this issue, compile and execute the following code snippet:
+
+using System;
+using System.IO;
+using System.Text;
+using System.CodeDom;
+using System.CodeDom.Compiler;
+using Microsoft.CSharp;
+
+public class EntryPoint
+{
+ public static void Main ()
+ {
+ StringWriter writer = new StringWriter ();
+ writer.NewLine = "\n";
+ CodeDomProvider provider = new CSharpCodeProvider ();
+ ICodeGenerator generator = provider.CreateGenerator ();
+ CodeGeneratorOptions options = new CodeGeneratorOptions ();
+ CodeCompileUnit compileUnit = new CodeSnippetCompileUnit (
+ "public class Test1 {}");
+ generator.GenerateCodeFromCompileUnit (compileUnit, writer, options);
+ writer.Close ();
+ Console.WriteLine (writer.ToString ());
+ }
+}
+
+Actual result:
+
+// ---------------------------------------------------
+// <autogenerated>
+// ....
+// </autogenerated>
+// ---------------------------------------------------
+
+Expected result:
+
+public class Test1 {}
+
+(with trailing \n)
+
+I'll commit an ignored unit tests to cvs
+(System/Test/Microsoft.CSharp/CodeGeneratorFromCompileUnitTest.cs).
More information about the mono-bugs
mailing list