Re: non-constant error for module AA"s

2011-01-25 Thread spir
On 01/25/2011 09:13 AM, Lars T. Kyllingstad wrote: On Mon, 24 Jan 2011 10:45:03 -0500, Andrej Mitrovic wrote: Is this a bug? import std.stdio; string[string] values = ["abc":"abc", "def":"def"]; void main() { string[string] values2 = ["abc":"abc", "def":"def"]; } test.d(3): Error: non

Re: non-constant error for module AA"s

2011-01-25 Thread spir
On 01/25/2011 08:54 AM, bearophile wrote: Andrej Mitrovic: It's interesting that enum works but immutable doesn't. enum will do, Thanks. But there are some problems with enum AAs. Take a look at this little program: enum int[int] aa = [1:2, 3:4]; int foo(int x) { return aa[x]; } void ma

Re: non-constant error for module AA"s

2011-01-25 Thread Lars T. Kyllingstad
On Mon, 24 Jan 2011 10:45:03 -0500, Andrej Mitrovic wrote: > Is this a bug? > > import std.stdio; > > string[string] values = ["abc":"abc", "def":"def"]; > > void main() > { > string[string] values2 = ["abc":"abc", "def":"def"]; > } > > > test.d(3): Error: non-constant expression ["abc":"

Re: non-constant error for module AA"s

2011-01-24 Thread bearophile
Andrej Mitrovic: > It's interesting that enum works but immutable doesn't. enum will do, Thanks. But there are some problems with enum AAs. Take a look at this little program: enum int[int] aa = [1:2, 3:4]; int foo(int x) { return aa[x]; } void main() {} And the asm of foo(): _D4test3fooF

Re: non-constant error for module AA"s

2011-01-24 Thread Andrej Mitrovic
On 1/24/11, BlazingWhitester wrote: > On 2011-01-24 17:45:03 +0200, Andrej Mitrovic said: > >> Is this a bug? >> >> import std.stdio; >> >> string[string] values = ["abc":"abc", "def":"def"]; >> >> void main() >> { >> string[string] values2 = ["abc":"abc", "def":"def"]; >> } >> >> >> test.d(3)

Re: non-constant error for module AA"s

2011-01-24 Thread BlazingWhitester
On 2011-01-24 17:45:03 +0200, Andrej Mitrovic said: Is this a bug? import std.stdio; string[string] values = ["abc":"abc", "def":"def"]; void main() { string[string] values2 = ["abc":"abc", "def":"def"]; } test.d(3): Error: non-constant expression ["abc":"abc","def":"def"] What's non-c

Re: non-constant error for module AA"s

2011-01-24 Thread spir
On 01/24/2011 04:45 PM, Andrej Mitrovic wrote: Is this a bug? import std.stdio; string[string] values = ["abc":"abc", "def":"def"]; void main() { string[string] values2 = ["abc":"abc", "def":"def"]; } test.d(3): Error: non-constant expression ["abc":"abc","def":"def"] What's non-consta

non-constant error for module AA"s

2011-01-24 Thread Andrej Mitrovic
Is this a bug? import std.stdio; string[string] values = ["abc":"abc", "def":"def"]; void main() { string[string] values2 = ["abc":"abc", "def":"def"]; } test.d(3): Error: non-constant expression ["abc":"abc","def":"def"] What's non-constant about that expression?