Inheriting from an interface twice
Simen kjaeraas
simen.kjaras at gmail.com
Fri Oct 1 08:45:32 PDT 2010
Trass3r <un at known.com> wrote:
>> void main()
>> {
>> Baz baz = new Baz();
>> Bar bar = baz;
>>
>> Foo foo1 = bar;
>> Foo foo2 = baz;
>>
>> assert(foo1 is foo2);
>> }
>>
>>
>> foo1 and foo2 have the same type and point to the same object. Yet they
>> have different addresses. Is it a bug, or a feature?
>
> Looks fine?! Isn't foo1 == foo2 what you want?
He mentioned that the code asserts. I say this is fishy, but I don't know
if it should assert or not.
--
Simen
More information about the Digitalmars-d
mailing list