www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4528] New: Better error message for private abstract method

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

           Summary: Better error message for private abstract method
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2010-07-28 15:20:52 PDT ---
With this wrong program:


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


dmd 2.047 generates the error message:
test.d(2): Error: function test.Foo.bar cannot be both final and abstract


With this other wrong program:

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


dmd generates the error message:
prog.d(2): Error: function test.Foo.bar non-virtual functions cannot be
abstract


But I think this second error message can be improved, because at first look
bar() looks virtual:

test.d(2): Error: member function test.Foo.bar() cannot be both private and
abstract.

Or (inspired by C# compiler):

test.d(2): Error: member function test.Foo.bar(): abstract functions cannot be
private.

Or (inspired by Java compiler):

test.d(2): Error: method test.Foo.bar(): illegal combination of modifiers:
abstract and private.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4528


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |andrej.mitrovich gmail.com
         AssignedTo|nobody puremagic.com        |andrej.mitrovich gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-12-27
16:59:52 PST ---
https://github.com/D-Programming-Language/dmd/pull/1415

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4528



--- Comment #2 from github-bugzilla puremagic.com 2013-03-17 18:24:16 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/47bbd55add98503755346b6db019b988c12b553a
Fixes Issue 4528 - Better diagnostic on non-virtual abstract method.

https://github.com/D-Programming-Language/dmd/commit/f138c299ade0c9be6341644ea02441d39338a57c
Merge pull request #1415 from AndrejMitrovic/Fix4528

Issue 4528 - Better diagnostic on non-virtual abstract method.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 17 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4528


Kenji Hara <k.hara.pg gmail.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 27 2013