Bug 17942 – Enums are evaluated differently in global scope

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-10-26T16:31:53Z
Last change time
2018-04-06T21:05:19Z
Keywords
industry
Assigned to
No Owner
Creator
Temtaime

Comments

Comment #0 by temtaime — 2017-10-26T16:31:53Z
import std.meta; enum B = aliasSeqOf!(gen()); // fails void main() { enum A = aliasSeqOf!(gen()); //works } string[] gen() { return null; // change to [ `` ] makes error go away }
Comment #1 by ag0aep6g — 2017-10-26T21:49:24Z
Reduced: ---- alias AliasSeq(TList...) = TList; enum B = AliasSeq!(); // fails void main() { enum A = AliasSeq!(); //works } ----
Comment #2 by bugzilla — 2018-03-25T06:46:10Z
Comment #3 by github-bugzilla — 2018-04-06T21:05:12Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/8c28783bbc6ccbef576bcc227cf6426277ef940b fix Issue 17942 - Enums are evaluated differently in global scope https://github.com/dlang/dmd/commit/cee0643ba4256bb1f24cbd24bb2b43435ea041a4 Merge pull request #8077 from WalterBright/fix17942 fix Issue 17942 - Enums are evaluated differently in global scope merged-on-behalf-of: Iain Buclaw <[email protected]>