www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14056] New: std.array.assocArray with a const value


          Issue ID: 14056
           Summary: std.array.assocArray with a const value
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: regression
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

This seems a regression, this used to work:

void main() {
    import std.array: assocArray;
    import std.typecons: Tuple;
    Tuple!(int, immutable(char))[] a1;
    immutable(char)[int] aa = assocArray(a1);

Dmd 2.067alpha gives:

test.d(5,41): Error: template std.array.assocArray cannot deduce function from
argument types !()(Tuple!(int, immutable(char))[]), candidates are:
std.array.assocArray(Range)(Range r) if (isInputRange!Range &&
ElementType!Range.length == 2 && isMutable!(ElementType!Range.Types[1]))

Jan 26 2015