www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13082] New: Spurious error message with failed call to class


          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 puremagic.com
          Reporter: bearophile_hugs 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.

Jul 09 2014