Bug 321411 (MONO78687) - [GMCS] nested class and constraints
Summary: [GMCS] nested class and constraints
Status: RESOLVED NORESPONSE
Alias: MONO78687
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: 2006-06-22 02:36 UTC by Krzys Ostrowski
Modified: 2007-11-05 12:25 UTC (History)
1 user (show)

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 20:01:53 UTC


---- Reported by kjo22@cornell.edu 2006-06-21 19:36:31 MST ----

Another example of broken generic support. I removed unimportant parts.
While parsing the "where" clause, your compiler complains that
Refcollection<K,T> doesn't have member "Element", even though it's there.
The same compiles without problems in Visual Studio.

    public class RefCollection<K,T> : IRefCollection<K,T> 
        where T : RefCollection<K,T>.Element, new() 
        where K : System.IComparable, System.IComparable<K>
    {
        public abstract class Element : 
             Collections2.BTNOf<K>, System.IDisposable
        {
            ...
        }

        ...
    }



---- Additional Comments From martin@ximian.com 2006-06-21 20:23:34 MST ----

And this is working for me.  Setting Priority to a sane value anyways.



---- Additional Comments From krzys@cs.cornell.edu 2006-06-21 21:47:28 MST ----

I've cut out too much, that's all. 
The following breaks the compiler.

--------------------------------------

    public interface IA<K> 
        where K : System.IComparable, System.IComparable<K>
    {
    }

    public class A<K> : IA<K> 
        where K : System.IComparable, System.IComparable<K>
    {
    }

    public interface IB<K,T> 
        where T : System.IDisposable
    {
    } 

    public class B<K,T> : IB<K,T> 
        where T : B<K,T>.Element, new() 
        where K : System.IComparable, System.IComparable<K>
    {
        public abstract class Element : A<K>
        {
        }
    }





---- Additional Comments From martin@ximian.com 2006-07-21 10:35:04 MST ----

Works for me.


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

Comment 1 Marek Safar 2007-11-05 12:25:20 UTC
No response, closing.