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

--- Comment #0 from 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 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 non-virtual functions cannot be

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

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

Or (inspired by C# compiler):

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

Or (inspired by Java compiler):

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

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to