[Mono-bugs] [Bug 76472][Nor] New - [GMCS] incorrect CS0309 / return
type constraint does not consider generic method argument
constraints
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed Oct 19 02:29:46 EDT 2005
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 atsushi at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=76472
--- shadow/76472 2005-10-19 02:29:46.000000000 -0400
+++ shadow/76472.tmp.20126 2005-10-19 02:29:46.000000000 -0400
@@ -0,0 +1,52 @@
+Bug#: 76472
+Product: Mono: Compilers
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com
+ReportedBy: atsushi at ximian.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: [GMCS] incorrect CS0309 / return type constraint does not consider generic method argument constraints
+
+The example code below results in CS0309 error as if generic "where T :
+IBar" does not exist.
+
+interface IFoo {}
+interface IBar {}
+
+class C1<IFoo> where IFoo : IBar
+{
+}
+
+abstract class C2
+{
+ public abstract C1<T> Hoge<T> () where T : IBar;
+}
+
+class C3 : C2
+{
+ public override C1<T> Hoge<T> () { return null; }
+}
+
+
+Actual Results:
+
+inherit-constraint2.cs(15,18): error CS0309: The type `T' must be
+convertible to `IBar' in order to use it as parameter `IFoo' in the generic
+type or method `C1`1<IFoo>'
+
+Expected Results:
+
+no CS0309 error.
+
+How often does this happen?
+
+consistently.
More information about the mono-bugs
mailing list