Bug 10946 – Integer constant expression expected instead of...

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-01T18:48:00Z
Last change time
2013-09-01T23:42:17Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
rtcvb32

Comments

Comment #0 by rtcvb32 — 2013-09-01T18:48:57Z
Known immutable named expression/variable not being accepted when it should be. Version: DMD32 D Compiler v2.063.2 enum len = 4; alias e1 = immutable(char)[len]; alias e2 = immutable(char[len]); //fails, line 9 alias immutable(char)[len] e3; alias immutable(char[len]) e4; //fails, line 11 immutable ilen = 4; alias i1 = immutable(char)[ilen]; alias i2 = immutable(char[ilen]); //fails, line 15 alias immutable(char)[ilen] i3; alias immutable(char[ilen]) i4; //fails, line 17 test.d(9): Error: Integer constant expression expected instead of len test.d(11): Error: Integer constant expression expected instead of len test.d(15): Error: Integer constant expression expected instead of ilen test.d(17): Error: Integer constant expression expected instead of ilen
Comment #1 by k.hara.pg — 2013-09-01T19:59:54Z
Comment #2 by github-bugzilla — 2013-09-01T23:42:02Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2a6e30fb5366310965abbc05e311849611cfcc70 [REG2.061] Issue 10946 - Integer constant expression expected instead of... https://github.com/D-Programming-Language/dmd/commit/8755c697f44933db35d98dd9b49dbc48a413c066 Merge pull request #2512 from 9rnsr/fix10946 [REG2.061] Issue 10946 - Integer constant expression expected instead of...