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 [EMAIL PROTECTED]

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

--- shadow/75492        2005-07-06 13:47:06.000000000 -0400
+++ shadow/75492.tmp.25227      2005-07-06 13:47:06.000000000 -0400
@@ -0,0 +1,58 @@
+Bug#: 75492
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: mono svn
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Cosmetic
+Component: C#
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] CS0310 not reported when creating generic type with new() 
contraint
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+gmcs allows instanciating generic parameter constrained with new() to a
+class without public parameterless constructor
+
+Steps to reproduce the problem:
+1. Compile
+
+class C <a> where a : new () {
+}
+
+class Foo {
+  public Foo (int x) { }
+}
+
+class X
+{
+        static void Main ()
+        {
+          C<Foo> x = new C<Foo>();
+        }
+}
+ 
+
+Actual Results:
+Compiles fine.
+
+Expected Results:
+t.cs(12,11): error CS0310: The type 'Foo' must have a public parameterless
+constructor in order to use it as parameter 'a' in the generic type or
+method 'C<a>'
+t.cs(1,7): (Location of symbol related to previous error)
+t.cs(4,7): (Location of symbol related to previous error)
+
+
+How often does this happen? 
+Always
+
+Additional Information:
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to