www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8928] New: Poor error message for derived class without constructor

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8928

           Summary: Poor error message for derived class without
                    constructor
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au



class X {
   this(int n) {}
}

class Y : X { }

qef.d(5): Error: constructor qef.Y.this no match for implicit super() call in
constructor
----
But Y doesn't have a constructor!

Seems the compiler generates an implicit constructor, and then complains that
it's erroneous.

Actually I'm not sure why it doesn't generate this(int n) { super(n); }, but
that's a different issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 01 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8928


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



22:26:45 PDT ---
How about:

Error: synthesized constructor qef.Y.this no match for implicit super() call in
constructor

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8928


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg gmx.com



PDT ---
"Synthesized?" That's a very odd choice of words, and actually, I'd argue that
it's outright incorrect. How about something more like

Error: Cannot generate default constructor for qef.Y, because its base class,
qef.X, has no default constructor.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8928




22:48:02 PDT ---

 "Synthesized?" That's a very odd choice of words, and actually, I'd argue that
 it's outright incorrect. 
It's standard terminology, you can look up the C++ reference manual if you wish. Here's a sample g++ error when the compiler implicitly generates a method: /usr/include/c++/4.4/iosfwd:56: note: synthesized method ‘std::basic_ios >& std::basic_ios >::operator=(const std::basic_ios >&)’ first required here -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8928




22:48:53 PDT ---


 "Synthesized?" That's a very odd choice of words, and actually, I'd argue that
 it's outright incorrect. 
It's standard terminology
But I'm not saying it's the best choice of words. So suggestions are welcome. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8928




PDT ---
Well, it really doesn't match the definition of synthesized at all, so I have
to wonder about whoever picked it for C++. Regardless, using it in an error
message like that isn't going to be clear to most programmers.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8928


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
         AssignedTo|nobody puremagic.com        |andrej.mitrovich gmail.com



14:42:53 PST ---
https://github.com/D-Programming-Language/dmd/pull/1336

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8928




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/6a4840212b1ee0611c9c8fecc59ec8500e8999ea
Fixes Issue 8928 - Improve error message with implicitly generated constructor.

https://github.com/D-Programming-Language/dmd/commit/4cc63a038e27356d5d60a93e57b794b37167cab0


[diag] Issue 8928 - Improve error message with implicitly generated constructor

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 09 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8928


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 27 2012