www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1289] New: Class method without a function body should be abstract?

reply d-bugmail puremagic.com writes:

           Summary: Class method without a function body should be abstract?
           Product: D
           Version: 1.016
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: onlystupidspamhere yahoo.se

The spec should state whether a method without a body is abstract or not. Of
course this also affects the behavior of compiler. For instance this fails when

  class A { A f(); }

  class B : A { B f() { return this; } }

  void main() { B a = new B(); }

In some occasions similar code works, in others it doesn't.

Jun 24 2007
parent d-bugmail puremagic.com writes:

bugzilla digitalmars.com changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

------- Comment #1 from bugzilla digitalmars.com  2007-06-28 15:13 -------
This is working as designed. It allows one to implement a member function
elsewhere than the class definition. To have an abstract class, it must have
the 'abstract' storage class.

Jun 28 2007