Bug 318741 (MONO75813) - [PATCH] mcs emit public ctor for private ctor that invokes base ctor
Summary: [PATCH] mcs emit public ctor for private ctor that invokes base ctor
Status: RESOLVED FIXED
Alias: MONO75813
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-14 18:26 UTC by Gert Driesen
Modified: 2007-09-15 21:24 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
proposed fix (414 bytes, patch)
2005-08-30 08:54 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:27:33 UTC


---- Reported by gert.driesen@pandora.be 2005-08-14 11:26:33 MST ----

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.



---- Additional Comments From atsushi@ximian.com 2005-08-30 01:54:07 MST ----

Created an attachment (id=168368)
proposed fix




---- Additional Comments From gert.driesen@pandora.be 2005-11-17 16:14:06 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO76736 has been marked as a duplicate of this bug. ***



---- Additional Comments From marek.safar@seznam.cz 2006-03-26 09:32:45 MST ----

Fixed in SVN.

Imported an attachment (id=168368)

Unknown operating system unknown. Setting to default OS "Other".