Summary: Calling .clear on a fresh associative array causes
                    subsequent segfault
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from Marco Leise <> 2011-03-02 14:52:05 PST ---
In DMD 2.051 and 2.052 the following code doesn't run:

void main() {
  int[char] test;
  test.clear;     // <- this provokes the bug
  test['x'] = 42;

This happens independently of the key type (int, char, struct). It seems like
associative arrays are not in the 'clear' state when they are created.
A typical use case is a field of a class that gets filled with values by a
method that needs to clear out old content if any. I considered this a major
bug, because it happens with a core feature.

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

Reply via email to