[Issue 13082] New: Spurious error message with failed call to class ctor

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 9 01:58:46 PDT 2014


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: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

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.

--


More information about the Digitalmars-d-bugs mailing list