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:
http://d.puremagic.com/issues/show_bug.cgi?id=1289

           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
linking:

  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:
http://d.puremagic.com/issues/show_bug.cgi?id=1289


bugzilla digitalmars.com changed:

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





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