www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24061] New: constructor with assert(0) failed to compile

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

          Issue ID: 24061
           Summary: constructor with assert(0) failed to compile
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: apz28 hotmail.com

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

--
Jul 27 2023