Nested interface

Read Bixby rbixby at hotmail.com
Sun Apr 1 13:55:48 PDT 2012


Thanks; entered as issue 7807.

On Sunday, 1 April 2012 at 20:17:09 UTC, Timon Gehr wrote:
> On 04/01/2012 08:13 PM, Read Bixby wrote:
>> Hm, I guess it's much simpler than that.  I must not be 
>> understanding
>> something about covariance.  The following code produces the 
>> same error
>> message (it has nothing to do with nestedness or shared 
>> classes):
>>
>>
>> interface Interface
>> {
>>     Interface getNext();
>>     const(Interface) getNext() const;
>> }
>>
>> class Implementation : Interface
>> {
>>     Implementation getNext()
>>     {
>>         return null;
>>     }
>>
>>     const(Implementation) getNext() const
>>     {
>>         return null;
>>     }
>> }
>>
>
> This is a compiler bug. It works if 'Interface' is changed to 
> an abstract class.
>
> Please report this issue to the bug tracker:
> http://d.puremagic.com/issues/




More information about the Digitalmars-d-learn mailing list