Thread overview
[Issue 22797] [REG master] Internal Compiler Error: cannot mixin static assert ''
Feb 20, 2022
Iain Buclaw
Feb 20, 2022
Iain Buclaw
Feb 20, 2022
Dlang Bot
Feb 20, 2022
Dlang Bot
February 20, 2022
https://issues.dlang.org/show_bug.cgi?id=22797

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Occurs when compiling these tests:

github.com/dlang/dmd/tree/master/test/runnable/mixin1.d

github.com/dlang/dmd/tree/master/test/runnable/testrightthis.d

--
February 20, 2022
https://issues.dlang.org/show_bug.cgi?id=22797

--- Comment #2 from Iain Buclaw <ibuclaw@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.

--
February 20, 2022
https://issues.dlang.org/show_bug.cgi?id=22797

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ibuclaw created dlang/dmd pull request #13695 "fix Issue 22797 - [REG master] Internal Compiler Error: cannot mixin static assert ''" fixing this issue:

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

https://github.com/dlang/dmd/pull/13695

--
February 20, 2022
https://issues.dlang.org/show_bug.cgi?id=22797

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #13695 "fix Issue 22797 - [REG master] Internal Compiler Error: cannot mixin static assert ''" was merged into master:

- 132e2b14a665abb87511017ea3a5666cf0b2f3b4 by Iain Buclaw:
  fix Issue 22797 - [REG master] Internal Compiler Error: cannot mixin static
assert ''

https://github.com/dlang/dmd/pull/13695

--