www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5128] New: Forbid abstract attribute for nonabstract methods

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5128

           Summary: Forbid abstract attribute for nonabstract methods
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2010-10-29 05:08:34 PDT ---
DMD 2.050beta compiles and runs this code with no errors, but bar() is not
actually abstract:


abstract class Foo {
    abstract void bar() {}
}
void main() {}


What I expect: A compile-time error, something like:
error(2): abstract method 'bar' of class 'Foo' has a body.

See also bug 2946

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 29 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5128


Stewart Gordon <smjg iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |smjg iname.com
         Resolution|                            |INVALID


--- Comment #1 from Stewart Gordon <smjg iname.com> 2010-10-31 10:15:27 PDT ---
http://www.digitalmars.com/d/1.0/attribute.html#abstract
http://www.digitalmars.com/d/2.0/attribute.html#abstract
"Functions declared as abstract can still have function bodies. This is so that
even though they must be overridden, they can still provide ‘base class
functionality.’"

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 31 2010