Bug 319333 (MONO76482) - [GMCS] gmcs emits extraneous base interfaces as generic parameter constraints
Summary: [GMCS] gmcs emits extraneous base interfaces as generic parameter constraints
Status: RESOLVED FIXED
Alias: MONO76482
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-19 21:20 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:35:24 UTC


---- Reported by atsushi@ximian.com 2005-10-19 14:20:59 MST ----

The code below shows all of the generic parameter constraints for a generic
argument of a generic method.

using System;
using System.Reflection;

public interface IFoo : ICloneable {}

public class Test
{
        public void Foo<T> () where T : IFoo {}

        public static void Main ()
        {
                foreach (Type t in typeof (Test).GetMethod ("Foo")
                        .GetGenericArguments () [0] // T
                        .GetGenericParameterConstraints ())
                        Console.WriteLine (t);
        }
}

Actual Results:

When it is compiled with gmcs and run, it outputs "IFoo" and "ICloneable".

Expected Results:

With csc, it only outputs "IFoo".

How often does this happen?

consistently.

Additional Information:

It is not a runtime/classlib matter but gmcs matter (gmcs-compiled binary
shows ICloneable on .NET).



---- Additional Comments From martin@ximian.com 2005-10-24 03:56:37 MST ----

Dammit - another such case where the spec is inconsistent:
classes do list all interfaces they implement (including inherited
interfaces), but type parameter constraints do not.



---- Additional Comments From martin@ximian.com 2005-10-24 04:30:34 MST ----

Fixed in SVN.


Unknown operating system unknown. Setting to default OS "Other".