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=76557 --- shadow/76557 2005-10-25 14:09:50.000000000 -0400 +++ shadow/76557.tmp.6466 2005-10-25 14:09:50.000000000 -0400 @@ -0,0 +1,60 @@ +Bug#: 76557 +Product: Mono: Compilers +Version: 1.1 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: C# +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: [GMCS] consider base interfaces for CS0309 + +gmcs does not seem to consider base interfaces of the constrained type +parameters on CS0309 computation. In the code below, K is IBar, thus it +should be regarded as to implement IFoo. So no CS0309 error should happen. + +(I'm not 100% sure if this understanding is right; it might be regarded as +a covariant.) + +interface IFoo {} +interface IBar : IFoo {} + +class Mona<T> where T : IFoo {} + +class Test +{ + public Mona<K> GetMona<K> () where K : IBar + { + return new Mona<K> (); + } + + public static void Main () {} +} + + +Actual Results: + +constraint-baseifaces.cs(8,9): error CS0309: The type `K' must be +convertible to `IFoo' in order to use it as parameter `T' in the generic +type or method `Mona`1<T>' +Compilation failed: 1 error(s), 0 warnings + +Expected Results: + +no error. + +How often does this happen? + +consistently. + +Additional Information: + +To my understanding, both of this generic type and this generic method are +(should be) marked as NonVariant. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
