Bug 321412 (MONO78688) - [GMCS] conversion missing
Summary: [GMCS] conversion missing
Status: RESOLVED NORESPONSE
Alias: MONO78688
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 04:34 UTC by Krzysztof Ostrowski
Modified: 2007-11-05 12:27 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 krzys@cs.cornell.edu 2006-06-21 21:34:58 MST ----

interface IA<C> where C : A<C>
{
}

class A<C> : IA<A<C>>
{
}

error CS0309: The type `A<C>' must be convertible to `A<A<C>>' in order to 
use it as parameter `C' in the generic type or method `IA<C>'

Works in Visual Studio.



---- Additional Comments From martin@ximian.com 2006-06-22 05:18:58 MST ----

We are correctly reporting the CS0309 here.



---- Additional Comments From krzys@cs.cornell.edu 2006-06-22 10:15:55 MST ----

I've cut out too much. Here's a more comprehensive example. It 
doesn't compile in Mono, but it does compiles in VS2005, and it's a 
perfectly legal C# code.

error CS0309: The type `E<K,C>' must be convertible to `ID<K,E<K,C>>' 
in order to use it as parameter `C' in the generic type or method 
`ID<K,C>'

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

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

    public interface IB<C> where C : IB<C> 
    {
    }

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

    public interface ID<K, C> : IC<K, C> where C : ID<K, C>, IC<K, C> 
where K : System.IComparable<K>
    {
    }

    public class E<K, C> : ID<K, E<K, C>> where C : IA<K> where K : 
System.IComparable<K>
    {
        int IComparable<K>.CompareTo(K other) { return 0; }
    }




---- Additional Comments From martin@ximian.com 2006-10-12 09:47:57 MST ----

Works for me.


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

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