Summary: Associative array with fixed sized array as value
                    issues a Range violation when inserting new value
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: druntime

--- Comment #0 from Guillaume Chatelet <> 
2010-11-30 15:17:14 PST ---

I'm new to D so this might not be a bug but something I misunderstood about the

I want to make an associative array of fixed sized array with double as key
The following code compiles
  int[2][double] map;
  map[0] = [1,2];
but fails at runtime with a "Range violation"

Surprisingly enough, the following code also compiles ?!
  int[1][double] map;
  map[0] = [1,2,3,4,5];
but fails alike at runtime.

It looks like the good way to do this is to use
  int[][double] map;
  map[0] = [1,2,3,4,5];

But then relaxing the type constraint... Any ideas ?

I'm using Digital Mars D Compiler v2.050 on linux x86.

Best regards,
Guillaume CHATELET

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

Reply via email to