Bug 321410 (MONO78686) - [GMCS] "recursive" constraints
Summary: [GMCS] "recursive" constraints
Status: RESOLVED FIXED
Alias: MONO78686
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Raja R Harinath
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-22 02:30 UTC by Krzys Ostrowski
Modified: 2007-09-15 21:24 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:52 UTC


---- Reported by kjo22@cornell.edu 2006-06-21 19:30:12 MST ----

The following doesn't compile in Mono, although it should (and it does
compile in Visual Studio). Your compiler complains about the AVLNode
definition, claiming that C is not known to be IBSTNode, although it's
clearly so for it is IAVLNode that inherits IBSTNode.

This is just one of many examples in which your C# compiler crashes on
generics code, for it cannot properly process circular dependencies.

    public interface INode<K> : IComparable<K> where K : IComparable<K>
    {
        K Key
        {
            get;
        }
    }

    public interface IBTNode<C> where C : IBTNode<C> 
    {
        C Parent
        {
            get;
            set;
        }

        C Left
        {
            get;
            set;
        }

        C Right
        {
            get;
            set;
        }
    }

    public interface IBSTNode<K, C> : IBTNode<C>, INode<K> 
        where C : IBSTNode<K, C> where K : IComparable<K>
    {
    }

    public interface IAVLNode<K, C> : IBSTNode<K, C> 
        where C : IAVLNode<K, C> where K : IComparable<K>
    {
        int Balance
        {
            get;
            set;
        }
    }



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

Setting priority to a sane value and fixing summary.



---- Additional Comments From martin@ximian.com 2006-06-21 20:41:59 MST ----

Slightly modified version of #78380, but with interfaces instead of
classes.



---- Additional Comments From martin@ximian.com 2006-06-21 22:22:06 MST ----

Fixed in SVN.


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