Bug 3381 – [tdpl] Incorrect assessment of overriding in triangular-shaped hierarchy

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2009-10-08T20:36:00Z
Last change time
2015-06-09T05:14:37Z
Keywords
diagnostic, patch, rejects-valid
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2009-10-08T20:36:16Z
This code doesn't compile: interface VisualElement { void draw(); } interface Actor { } interface VisualActor : Actor, VisualElement { } class Sprite3 : Actor, VisualActor { override void draw() { } } The error message is: Error: function test.Sprite3.draw does not override any function If I comment out the implementation of draw I get: Error: class test.Sprite3 interface function VisualElement.draw isn't implemented Of course, both of these can't be true at the same time :o). The original program should compile and run properly.
Comment #1 by gide — 2009-10-09T02:10:50Z
Looks like at dup of bug 3023.
Comment #2 by clugdbug — 2009-10-19T12:13:55Z
Ha! Compiler bugs are not usually this silly. Applies to D1 as well. This also fixes bug 3023. I suspect it probably fixes some other bugs too -- I'm amazed multiple inheritance has worked at all. class.c, line 1198. // Skip if b has already appeared for (int k = 0; k < i; k++) { - if (b == interfaces[i]) + if (b == interfaces[k]) goto Lcontinue; }
Comment #3 by clugdbug — 2009-10-19T12:15:37Z
*** Issue 3023 has been marked as a duplicate of this issue. ***
Comment #4 by leandro.lucarella — 2009-10-19T12:46:00Z
I wonder you (Andrei) don't search for existing bugs instead of blindly creating new ones =( If you want to mark all TDPL bugs by prefixing [tldp] to the subject, you can edit the old bug's title. I'm saying this because I saw several bugs which were duplicates of old ones.
Comment #5 by andrei — 2009-10-19T12:55:57Z
(In reply to comment #4) > I wonder you (Andrei) don't search for existing bugs instead of blindly > creating new ones =( > > If you want to mark all TDPL bugs by prefixing [tldp] to the subject, you can > edit the old bug's title. > > I'm saying this because I saw several bugs which were duplicates of old ones. I'll try to look harder. My problem is that I never know what keywords to look for.
Comment #6 by wbaxter — 2009-11-22T06:53:43Z
Looks like bug 2252 might be the same thing too.
Comment #7 by leandro.lucarella — 2009-11-22T14:33:12Z
Comment #8 by bugzilla — 2009-12-06T00:46:29Z
Fixed dmd 1.053 and 2.037