digitalmars.D.learn - Integer constant expression expected instead of...
- Era Scarecrow (10/10) Sep 01 2013 [code]
- bearophile (9/18) Sep 01 2013 It could be a regression. You could file it in Bugzilla.
- Era Scarecrow (5/20) Sep 01 2013 alias NString = immutable(char)[fieldEntryLength]; //works
- Era Scarecrow (2/2) Sep 01 2013 Added:
[code] enum fieldEntryLength = 4; //immutable fieldEntryLength = 4; //same issue alias immutable(char[fieldEntryLength]) NString; [/code] test.d(10): Error: Integer constant expression expected instead of fieldEntryLength This breaks code that previously compiled. I really don't see the problem... bug? Version: Windows DMD32 D Compiler v2.063.2
Sep 01 2013
Era Scarecrow:[code] enum fieldEntryLength = 4; //immutable fieldEntryLength = 4; //same issue alias immutable(char[fieldEntryLength]) NString; [/code] test.d(10): Error: Integer constant expression expected instead of fieldEntryLength This breaks code that previously compiled. I really don't see the problem... bug?It could be a regression. You could file it in Bugzilla. In the meantime this seems to work (I have also used the new alias syntax. Eventually the old alias syntax should be deprecated): enum fieldEntryLength = 4; alias NString = immutable(char)[fieldEntryLength]; Bye, bearophile
Sep 01 2013
On Monday, 2 September 2013 at 01:19:44 UTC, bearophile wrote:Era Scarecrow:alias NString = immutable(char)[fieldEntryLength]; //works alias NString = immutable(char[fieldEntryLength]); //fails I wonder why this is the case... It's a fixed number either way...[code] enum fieldEntryLength = 4; //immutable fieldEntryLength = 4; //same issue alias immutable(char[fieldEntryLength]) NString; [/code] test.d(10): Error: Integer constant expression expected instead of fieldEntryLengthIt could be a regression. You could file it in Bugzilla. In the meantime this seems to work (I have also used the new alias syntax. Eventually the old alias syntax should be deprecated): enum fieldEntryLength = 4; alias NString = immutable(char)[fieldEntryLength];
Sep 01 2013
Added: http://d.puremagic.com/issues/show_bug.cgi?id=10946
Sep 01 2013