www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8984] New: Dynamic array key for associative array

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8984

           Summary: Dynamic array key for associative array
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



void main() {
    int[int[]] aa;
    aa[[1]] = 2;
}


Is this error message correct? DMD 2.061alpha:

test.d(3): Error: associative arrays can only be assigned values with immutable
keys, not int[]

I think the dynamic array literal [1] should be implicitly convertible to
immutable.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 08 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8984


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh quickfur.ath.cx



Isn't the complaint that the type of the AA should be int[immutable(int)[]],
not int[int[]]?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 17 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8984





 Isn't the complaint that the type of the AA should be int[immutable(int)[]],
 not int[int[]]?
This code gives the same error: void main() { int[immutable(int)[]] aa; aa[[1]] = 2; } test.d(3): Error: associative arrays can only be assigned values with immutable keys, not int[] Not giving an error at the definition point of the associative array is another bug that I have reported elsewhere (that I think Walter doesn't want to fix). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 17 2012