SomeDude <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #7 from SomeDude <> 2012-04-27 07:32:41 
PDT ---
The following program doesn't compile with 2.059:

import std.stdio, std.container, std.range;

string[char] aa = ['f':"foo", 'b':"bar"];

void main(){
    foreach (ch, str; aa) {
      writefln("[%s]: [%s]", ch, str);

It gives:
PS E:\DigitalMars\dmd2\samples> rdmd  -O -inline bug.d
bug.d(3): Error: non-constant expression ['f':"foo",'b':"bar"]
PS E:\DigitalMars\dmd2\samples>

This also happens with the following:
const string[char] aa = ['f': "foo",'b': "bar"];
static const string[char] aa = ['f': "foo",'b': "bar"];
immutable string[char] aa = ['f': "foo",'b': "bar"];
static immutable string[char] aa = ['f': "foo",'b': "bar"];

Only this compiles:
enum string[char] aa = ['f': "foo",'b': "bar"];

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to