Bugzilla – Bug 319423
[GMCS] (cf. #76551) missing "class" constraints on abstract generic method IL
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by atsushi@ximian.com 2005-10-28 14:10:21 MST ---- Similar to #76551, gmcs misses class constraints on abstract/overriden methods: using System; using System.Reflection; public abstract class Foo<T> where T : class { public abstract Foo<K> UseT<K> () where K : class; } public class Bar<T> : Foo<T> where T : class { public override Foo<K> UseT<K> () { return default (Foo<K>); } } public class Test { public static void Main () { MethodInfo mi = typeof (Bar<object>) .GetGenericTypeDefinition ().GetMethod ("UseT"); foreach (Type t in mi.GetGenericArguments ()) Console.WriteLine (":::{0} {1}", t, t.GenericParameterAttributes); } } Compile with gmcs and run either on MS.NET or Mono. Actual Results: :::K None Expected Results: :::K ReferenceTypeConstraint How often does this happen? consistently. ---- Additional Comments From martin@ximian.com 2005-10-28 18:21:04 MST ---- Should be easy. ---- Additional Comments From martin@ximian.com 2005-10-28 18:23:06 MST ---- Ooops, I wanted to ACCEPT the bug not close it. ---- Additional Comments From martin@ximian.com 2005-11-23 14:11:16 MST ---- Fixed in SVN. Unknown operating system unknown. Setting to default OS "Other".