[Mono-bugs] [Bug 75813][Nor] New - mcs emit public ctor for private ctor that invokes base ctor

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Aug 14 11:26:33 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=75813

--- shadow/75813	2005-08-14 11:26:33.000000000 -0400
+++ shadow/75813.tmp.2567	2005-08-14 11:26:33.000000000 -0400
@@ -0,0 +1,46 @@
+Bug#: 75813
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs emit public ctor for private ctor that invokes base ctor
+
+When a private ctor invokes a base ctor, mcs emits a public ctor instead.
+
+To reproduce this issue, compile and run the following code snippet:
+
+using System;
+using System.Reflection;
+
+public class A {
+  public static void Main () {
+    ConstructorInfo ctor = typeof(A).GetConstructor(
+      BindingFlags.Public | BindingFlags.Instance,
+      null, new Type[0], null);
+    if (ctor != null) {
+      Console.WriteLine ("Public instance ctor found!");
+    }
+  }
+
+  private A() : base() {
+  }
+}
+
+Actual result:
+
+Public instance ctor found
+
+Expected result:
+
+No output on console as no public ctor exists for class A.


More information about the mono-bugs mailing list