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=77548 --- shadow/77548 2006-02-13 19:13:29.000000000 -0500 +++ shadow/77548.tmp.5142 2006-02-13 19:13:29.000000000 -0500 @@ -0,0 +1,49 @@ +Bug#: 77548 +Product: Mono: Compilers +Version: 1.1 +OS: +OS Details: Mandrake 10 +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: C# +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: BadCS0310 error when generic with new() constraint used as own argument + +Description of Problem: + +With the following code: + +class Test { + + public class Generic<T> where T : new() { + public Generic() { + T tmp = new T(); + } + } + + public Generic<int> okay; + + public Generic<Generic<int>> bad; + + public static void Main() {} + +} + +I get the following errors from gmcs (from mono 1.1.13.2_0): + +generic-bug.cs(11): error CS0310: The type `Test.Generic<int>' must have a +public parameterless constructor in order to use it as parameter `T' in the +generic type or method `Test.Generic<T>' +generic-bug.cs(3):: `Test.Generic<T>', name of symbol related to previous error +generic-bug.cs(3):: `Test.Generic<T>', name of symbol related to previous error +Compilation failed: 1 error(s), 0 warnings + +Visual Studio 2005 accepts the code, and of course Test.Generic<int> does +have a public parameterless constructor. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
