On Friday, 4 January 2019 at 00:19:05 UTC, Alex wrote:
On Friday, 4 January 2019 at 00:15:28 UTC, Neia Neutuladh wrote:
On Thu, 03 Jan 2019 23:44:15 +0000, Alex wrote:
I assume that is another bug and has nothing to do with interfaces...

B.foo is both overriding A.foo and implementing D.foo, so that's not a bug.

I don't have any interfaces in my example.
B.foo overrides A.foo. By casting a B object to be an A object, A's behavior should be granted, shouldn't it?

No, because you OVERRIDE A's foo().

A does not exist. A is B and when you cast B to A you just tell the compiler that the reference should only have A's signature available.

You're not assigning B to A.
              • Re:... Simen Kjærås via Digitalmars-d-learn
              • Re:... Alex via Digitalmars-d-learn
              • Re:... bauss via Digitalmars-d-learn
              • Re:... Alex via Digitalmars-d-learn
              • Re:... kdevel via Digitalmars-d-learn
              • Re:... Steven Schveighoffer via Digitalmars-d-learn
              • Re:... kdevel via Digitalmars-d-learn
              • Re:... Steven Schveighoffer via Digitalmars-d-learn
              • Re:... bauss via Digitalmars-d-learn
              • Re:... Alex via Digitalmars-d-learn
          • Re: reimplem... bauss via Digitalmars-d-learn
            • Re: rei... Alex via Digitalmars-d-learn
              • Re:... Ali Çehreli via Digitalmars-d-learn
              • Re:... Alex via Digitalmars-d-learn
              • Re:... Ali Çehreli via Digitalmars-d-learn
              • Re:... Neia Neutuladh via Digitalmars-d-learn
              • Re:... Alex via Digitalmars-d-learn
    • Re: reimplementing an in... Heromyth via Digitalmars-d-learn
  • Re: reimplementing an interfa... bauss via Digitalmars-d-learn

Reply via email to