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

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-02-20T15:59:41Z
Last change time
2022-02-20T17:21:56Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2022-02-20T15:59:41Z
Comment #1 by ibuclaw — 2022-02-20T16:00:50Z
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
Comment #2 by ibuclaw — 2022-02-20T16:05:22Z
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.
Comment #3 by dlang-bot — 2022-02-20T16:44:59Z
@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
Comment #4 by dlang-bot — 2022-02-20T17:21:56Z
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