Top 5

Frank Benoit keinfarbton at googlemail.com
Thu Oct 9 12:31:38 PDT 2008


Andrei Alexandrescu schrieb:
> Robert Fraser wrote:
>> Frank Benoit wrote:
>>> Andrei Alexandrescu schrieb:
>>>> Ok, per Aarti's suggestion: without speaking officially for Walter, let
>>>> me ask this - what do you think are the top issues you'd like to see
>>>> fixed in D?
>>>>
>>>> Andrei
>>>
>>> class to interface compatibility
>>
>> This.
> 
> What is it?
> 
> Andrei

interface I {
}

I i1 = getInstance();
I i2 = getAnotherInstance();
bool res = (cast(Object)i1).opEquals( cast(Object) i2 );
bool res = i1 == i2; // should be this

If you really use interfaces and code that simply manages some objects,
you often need those silly casts.

alias HashSet!(I) MySet; // error, interface has no .toHash

Every interface is in fact at least of type Object.

>>>Except M$-COM<<< But this is a _special_ case and can be handled in a
lib. Even in Java this is possible. Its ridiculous that because of COM
in D there is no compatibility  between interfaces and class Object.









More information about the Digitalmars-d mailing list