Bug 10584 – Unhelpful error default constructing nested class

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-09T11:21:07Z
Last change time
2022-01-14T06:55:53Z
Keywords
bootcamp, diagnostic, pull
Assigned to
No Owner
Creator
Peter Alexander

Comments

Comment #0 by peter.alexander.au — 2013-07-09T11:21:07Z
class A { class B {} B b = new B(); } Error: 'this' is only defined in non-static member functions, not A. This error isn't particularly helpful, since I don't explicitly request this. The error should state that constructing B requires a this reference, which isn't available for default construction.
Comment #1 by dlang-bot — 2021-12-27T17:03:31Z
@wolframw created dlang/dmd pull request #13463 "Fix issue 10584 - Unhelpful error default constructing nested class" fixing this issue: - Fix issue 10584 - Unhelpful error default constructing nested class https://github.com/dlang/dmd/pull/13463
Comment #2 by dlang-bot — 2022-01-14T06:55:53Z
dlang/dmd pull request #13463 "Fix issue 10584 - Unhelpful error default constructing nested class" was merged into master: - 3032474eb94193e0e2b59ed7a0717991760ef2a8 by wolframw: Fix issue 10584 - Unhelpful error default constructing nested class https://github.com/dlang/dmd/pull/13463