Bug 8631 – illegal overrides accepted

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-08T14:38:00Z
Last change time
2013-01-19T12:19:31Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
timon.gehr

Comments

Comment #0 by timon.gehr — 2012-09-08T14:38:07Z
DMD 2.060: class OVIC{ int foo()immutable{ return 2; } int foo()const{ return 2; } } class OVIbICSC: OVIC{ override int foo()immutable{ return 2; } override int foo()const shared{ return 2; } override int foo()const{ return 2;} } The first two child methods override the same parent method, but DMD does not detect this.
Comment #1 by maxim — 2012-09-08T22:46:33Z
Why it is a bug?
Comment #2 by samukha — 2013-01-04T10:14:33Z
(In reply to comment #1) > Why it is a bug? Why is it not a bug? Actually, the first and third methods in the derived class override the base methods. The "const shared" method doesn't override anything. It is an additional entry in vtbl.
Comment #3 by k.hara.pg — 2013-01-08T19:37:38Z
Comment #4 by github-bugzilla — 2013-01-19T11:47:58Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0bfc49f23744a6bf92fa36e5e925b65635e4d5d4 fix Issue 8631 - illegal overrides accepted https://github.com/D-Programming-Language/dmd/commit/199fc70dcb1d03adc674d613ced0e9b8b5c83aa3 Merge pull request #1450 from 9rnsr/fix8631 Issue 8631 - illegal overrides accepted