Compiler dmd_2.068.0-0_amd64.deb on Ubuntu 12.04 Linux:
auto lookup = [ one:1, two:2 ];
The dmd error:
Error: non-constant expression [one:1, two:2]
Why doesn't it compile?
As a workaround I could do the assignment one element at a time
in a loop. It would be uglier though.
On 08/13/2015 11:48 PM, Adel Mamin wrote:
Compiler dmd_2.068.0-0_amd64.deb on Ubuntu 12.04 Linux:
auto lookup = [ one:1, two:2 ];
The dmd error:
Error: non-constant expression [one:1, two:2]
I think the problem is when the variable is defined at module scope. It
works inside functions, etc.
On Friday, 14 August 2015 at 06:48:27 UTC, Adel Mamin wrote:
Compiler dmd_2.068.0-0_amd64.deb on Ubuntu 12.04 Linux:
auto lookup = [ one:1, two:2 ];
The dmd error:
Error: non-constant expression [one:1, two:2]
Why doesn't it compile?
As a workaround I could do the assignment one element at a
On Friday, 14 August 2015 at 07:04:53 UTC, BBasile wrote:
It's because of the key type (string is a library type).
This is not true. It's not because of the key type. And string is
not a library type.
It's because it's implemented in DMD only partly.
There's a bug report associated with it.