www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14997] New: __ctor present in error message

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

          Issue ID: 14997
           Summary: __ctor present in error message
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: doob me.com

The following code:

module main;

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

Results in the following error message:

main.d(10): Error: None of the overloads of '__ctor' are callable using
argument types (), candidates are:
main.d(5):        main.Foo.this(int a)
main.d(6):        main.Foo.this(string a)

Since __ctor is an internal symbol not visible in the source code I would
consider this a bug. The change causing this error message was introduced
somewhere between 2.065.0 and 2.066.0. The error message for 2.065.0 looks like
this:

main.d(10): Error: constructor main.Foo.this (int a) is not callable using
argument types ()

--
Sep 01 2015