Details
Description
External code:
using System.Collections.Generic; public class D { } public class C<T> { public IEnumerable<U> Do<U> () where U : T { return null; } }
Caller code:
class B:
pass
C[of B]().Do[of B]() #B is internal, it works!
C[of D]().Do[of D]() #D is external -> BCE0149 :(
Gives:
BCE0149: The type 'B' must derive from 'T' in order to substitute the generic parameter 'U' in 'C[of T].Do()'.
Marking it Blocker for 0.9.1 as it blocks MonoDevelop guys wrt BooBinding.
Thanks to Michael Hutchinson for reporting.
FWIW, internal code works (testcase-worthy anyway):
class B:
pass
class D (B):
pass
class C[of T]:
def Do[of U(T)]() as U*:
pass
C[of B]().Do[of B]()
Issue Links
- is related to
-
BOO-1166
Ambiguous reference with generic argument constraint when current type inherits a generic type
-
Simplified testcase