Bug 24061 – constructor with assert(0) failed to compile

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-07-27T18:15:40Z
Last change time
2023-08-02T11:14:33Z
Keywords
pull
Assigned to
No Owner
Creator
apham

Comments

Comment #0 by apz28 — 2023-07-27T18:15:40Z
class E : Exception { this(int i) nothrow @safe { import std.format; scope (failure) assert(0, "assume nothrow"); super(format("%d", i), null, 0, null); } } void main() { throw new E(1); } onlineapp.d(3): Error: constructor `onlineapp.E.this` no match for implicit `super()` call in constructor
Comment #1 by dlang-bot — 2023-08-01T09:38:36Z
@RazvanN7 created dlang/dmd pull request #15489 "Fix Issue 24061 - constructor with assert(0) failed to compile" fixing this issue: - Fix Issue 24061 - constructor with assert(0) failed to compile https://github.com/dlang/dmd/pull/15489