Bug 17354 – An overload in a final class can silently hide base methods

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-04-26T19:37:00Z
Last change time
2017-06-10T20:24:53Z
Assigned to
nobody
Creator
b2.temp
See also
https://issues.dlang.org/show_bug.cgi?id=17349

Comments

Comment #0 by b2.temp — 2017-04-26T19:37:59Z
Try this: final class Foo { bool opEquals(const Object) const {return true;} } void main(){} Then this: class Foo { bool opEquals(const Object) const {return true;} } void main(){} In the first case the hijacking is detected. in the second, everything compiles finely. This is why jenkins test failed here: https://github.com/dlang/dmd/pull/6731#issuecomment-297327652
Comment #1 by b2.temp — 2017-04-26T19:42:56Z
No it's not detected in the first (final class) and detected in the second
Comment #2 by bugzilla — 2017-05-09T16:12:55Z