[Issue 21497] New: "Error: unknown" for generating struct using CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 20 16:28:49 UTC 2020


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

          Issue ID: 21497
           Summary: "Error: unknown" for generating struct using CTFE
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: tim.dlang at t-online.de

//////////////// test.d ////////////////
struct T
{
        ubyte[16] data;
}

void assignZero(T)(ref T dst)
{
        dst[] = 0;
}

static test =
        {
                T r;
                r.data.assignZero();
                return r;
        }();
////////////////////////////////////////

dmd v2.094.2 gives the following error message when compiling:
test.d(14):        called from here: assignZero(r.data)
test.d(16):        called from here: (*function () pure nothrow @nogc @safe =>
r)()
Error: unknown, please file report on issues.dlang.org

--


More information about the Digitalmars-d-bugs mailing list