[Issue 22797] [REG master] Internal Compiler Error: cannot mixin static assert ''

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 20 16:05:22 UTC 2022


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

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
The problem is this line:

https://github.com/dlang/dmd/blob/309f7710f22ef92e767434011c7f44a01d2c5390/src/dmd/statementsem.d#L4823

    else if (s.kind() == "static assert" ||  // kludge, should have
isStaticAssert()


`kind()` returns a `const(char)*`, and "static assert" is a string.  So it
relies on pointer comparison, which only works when statementsem.d and
staticassert.d are compiled together in the same compilation unit.  i.e: string
merging means that both "static assert" strings point to the same area in data.

--


More information about the Digitalmars-d-bugs mailing list