Bug 319423 (MONO76584) - [GMCS] (cf. #76551) missing "class" constraints on abstract generic method IL
Summary: [GMCS] (cf. #76551) missing "class" constraints on abstract generic method IL
Status: RESOLVED FIXED
Alias: MONO76584
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-28 21:10 UTC by Atsushi Enomoto
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:36:36 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".