Bug 21642 – [REG 2.084] hashOf will fail to compile for some structs/unions that recursively contain shared enums

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-02-17T08:16:44Z
Last change time
2021-03-05T23:44:53Z
Keywords
pull
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2021-02-17T08:16:44Z
The following code compiles with DMD 2.067.1 to 2.083.1 but fails to compile on 2.084.1: --- void main() { enum C : char { _ = 1, } union U { C c; void[0] _; } shared union V { U u; } cast(void) hashOf(V.init); } --- The underlying issue is a problem with the CTFE path for getting the byte representation of shared enum members. The following code has never compiled but that only became a problem after 2.084: --- void main() { import core.internal.convert : toUbyte; enum C : char { _ = 1, } shared C c; cast(void) toUbyte(c); } ---
Comment #1 by dlang-bot — 2021-02-17T08:21:52Z
@n8sh created dlang/druntime pull request #3376 "[REG 2.084] hashOf will fail to compile for some structs/unions that recursively contain shared enums" fixing this issue: - Fix Issue 21642 - [REG 2.084] hashOf will fail to compile for some structs/unions that recursively contain shared enums https://github.com/dlang/druntime/pull/3376
Comment #2 by dlang-bot — 2021-03-03T09:51:33Z
dlang/druntime pull request #3376 "[REG 2.084] hashOf will fail to compile for some structs/unions that recursively contain shared enums" was merged into stable: - 1256439d8782412b5dfc00b6a828ac5971065f1e by Nathan Sashihara: Fix Issue 21642 - [REG 2.084] hashOf will fail to compile for some structs/unions that recursively contain shared enums https://github.com/dlang/druntime/pull/3376
Comment #3 by dlang-bot — 2021-03-05T23:44:53Z
dlang/druntime pull request #3388 "merge stable" was merged into master: - 150823db4d2504172a3e84b50487f52cb1210e2b by Nathan Sashihara: Fix Issue 21642 - [REG 2.084] hashOf will fail to compile for some structs/unions that recursively contain shared enums https://github.com/dlang/druntime/pull/3388