Thread overview
[Issue 4019] New: [CTFE] Adding an item to an AA
[Issue 4019] [CTFE] Adding an item to an empty AA
Apr 01, 2010
Walter Bright
Apr 10, 2010
Don
Nov 09, 2012
Mike van Dongen
Nov 14, 2012
Don
March 28, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4019

           Summary: [CTFE] Adding an item to an AA
           Product: D
           Version: future
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2010-03-28 06:30:20 PDT ---
Problem found in dmd 2.042. This doesn't compile:

int foo() {
    int[int] aa;
    aa[1] = 2;
    return 0;
}
enum _ = foo();
void main() {}


Giving the errors:

test.d(3): Error: Cannot index null array aa
test.d(6): Error: cannot evaluate foo() at compile time
test.d(6): Error: cannot evaluate foo() at compile time

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 01, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4019


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com


--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2010-04-01 13:54:06 PDT ---
changeset 429

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 10, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4019


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug@yahoo.com.au
         Resolution|                            |FIXED


--- Comment #2 from Don <clugdbug@yahoo.com.au> 2010-04-09 19:20:38 PDT ---
Fixed DMD1.058 and DMD2.043.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 09, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4019


Mike van Dongen <puremagic@mikevandongen.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |puremagic@mikevandongen.nl
            Version|future                      |D2
         Resolution|FIXED                       |


--- Comment #3 from Mike van Dongen <puremagic@mikevandongen.nl> 2012-11-09 02:32:55 PST ---
It seems that when I use an 2D AA this problem still occurs. This is the code I used:


enum auto i = test();

int test()
{
    string[][string] s;
    s["a"] ~= "anything";

    return 6;
}


It gives me almost the same error (on Linux x64) the OP had:

Error: cannot index null array s

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 14, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4019


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #4 from Don <clugdbug@yahoo.com.au> 2012-11-14 01:38:11 PST ---
(In reply to comment #3)
> It seems that when I use an 2D AA this problem still occurs.

Your test case is completely different to the original bug, it is a bug in ~=.

Please do not reopen ancient bugs. The *only* time you should open a bug which was listed as fixed in a previous changelog, is if you find that the test cases in bug weren't actually fixed in that release.

Moved to bug 9023.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------