[Mono-bugs] [Bug 52596][Wis] New - The default ctor of an abstract type should be protected

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 4 Jan 2004 23:30:32 -0500 (EST)


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 bmaurer@users.sf.net.

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

--- shadow/52596	2004-01-04 23:30:32.000000000 -0500
+++ shadow/52596.tmp.31915	2004-01-04 23:30:32.000000000 -0500
@@ -0,0 +1,42 @@
+Bug#: 52596
+Product: Mono/Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: The default ctor of an abstract type should be protected
+
+using System;
+using System.Reflection;
+using BF = System.Reflection.BindingFlags;
+
+abstract class A {
+}
+
+class B : A {
+	static void Main () {
+		ConstructorInfo ci = typeof (A).GetConstructor
+			(BF.Public | BF.NonPublic | BF.Instance, null, new Type [0], new
+ParameterModifier [0]);
+		
+		Console.WriteLine (ci.IsFamily);
+	}
+}
+
+MS prints true, we print false.
+
+17.10.4: Default constructors:
+
+`If the class is abstract then the declared accessibility for the default
+constructor is protected. Otherwise, the declared accessibility for the
+default constructor is public.'