Bug 1419 – dup attr not checked in the sub-class

Status
RESOLVED
Resolution
INVALID
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-08-13T13:24:00Z
Last change time
2014-02-16T15:26:23Z
Assigned to
bugzilla
Creator
someanon

Comments

Comment #0 by someanon — 2007-08-13T13:24:15Z
dupdefbug.d: ================================ class A { int attr; } class B : A { int attr; } ================================ $ dmd.exe -c dupdefbug.d no error reported. It should report B.attr is dup of A.attr.
Comment #1 by bugzilla — 2007-08-13T13:34:11Z
Why should it be an error? Fields are not accessed virtually, so there is no hijacking problem. The current behavior is as designed. If you feel it should be changed, please start a thread in digitalmars.D and present the case.
Comment #2 by someanon — 2007-08-13T13:46:25Z
Posted to digitalmars.D: I think 90% of the time this happens it is a bug, not by the programmer's intention. If it's designed to be so in D, I propose to change it; or at least reported by the compiler.
Comment #3 by someanon — 2007-11-03T00:24:10Z
Comment #4 by someanon — 2007-11-03T00:26:40Z
or at least add a compiler flag to warn the user.
Comment #5 by bugzilla — 2007-11-03T00:54:50Z
I haven't changed my mind about it <g>.