www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17354] New: An overload in a final class can silently hide

https://issues.dlang.org/show_bug.cgi?id=17354

          Issue ID: 17354
           Summary: An overload in a final class can silently hide base
                    methods
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

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

--
Apr 26 2017