Thread overview | ||||||
---|---|---|---|---|---|---|
|
September 02, 2013 Integer constant expression expected instead of... | ||||
---|---|---|---|---|
| ||||
[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 |
September 02, 2013 Re: Integer constant expression expected instead of... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Era Scarecrow | 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 |
September 02, 2013 Re: Integer constant expression expected instead of... | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Monday, 2 September 2013 at 01:19:44 UTC, bearophile wrote: > 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 > > 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]; 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... |
September 02, 2013 Re: Integer constant expression expected instead of... | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | Added: http://d.puremagic.com/issues/show_bug.cgi?id=10946 |
Copyright © 1999-2021 by the D Language Foundation