Bug 17799 – Disallow enum with indirections

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-09-01T23:29:30Z
Last change time
2024-12-13T18:54:23Z
Assigned to
No Owner
Creator
Bolpat
Moved to GitHub: dmd#19311 →

Comments

Comment #0 by qs.il.paperinik — 2017-09-01T23:29:30Z
It is easily overseen that using enums creates a new instance every time as enums usually have types without indirections or are immutable (e.g. strings). enum foo = [1,2,3]; results in assert(foo !is foo); which is weird. Any other identifier that represents an array wouldn't have this oddity. Make it hard to use incorrectly and disallow enums that have mutable indirections. See https://forum.dlang.org/post/[email protected]
Comment #1 by robert.schadek — 2024-12-13T18:54:23Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19311 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB