www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12866] New: appens to std.container.Array of fixed size arrays


          Issue ID: 12866
           Summary: appens to std.container.Array of fixed size arrays
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

void main() {
    import std.container: Array;
    alias V3 = int[3];
    V3 v = [1, 2, 3];
    Array!V3 arr;
    arr ~= v;

DMD 2.066alpha gives:

...\dmd2\windows\bin\..\..\src\phobos\std\container.d(2890): Error: template
std.container.Array!(int[3]).Array.insertBack cannot deduce function from
argument types !()(int[]), candidates are:
std.container.Array!(int[3]).Array.insertBack(Stuff)(Stuff stuff) if
(isImplicitlyConvertible!(Stuff, T) || isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, T))
temp.d(6): Error: template instance
std.container.Array!(int[3]).Array.opOpAssign!("~", int[3]) error instantiating

Jun 06 2014