https://issues.dlang.org/show_bug.cgi?id=13082

          Issue ID: 13082
           Summary: Spurious error message with failed call to class ctor
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: [email protected]
          Reporter: [email protected]

class Foo {
    this(int a) {}
}
void main() {
    string b;
    new Foo(b);
}



dmd 2.066beta gives:

test.d(6,5): Error: constructor test.Foo.this (int a) is not callable using
argument types (string)
test.d(6,5): Error: no constructor for Foo

I suggest to omit the second error message. It's better to give only useful
error messages and reduce the noise. Reducing the noise is very useful for
longer programs that give many error messages.

--

Reply via email to