www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12911] New: `std.array.array` doesn't work for non-mutable


          Issue ID: 12911
           Summary: `std.array.array` doesn't work for non-mutable classes
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: verylonglogin.reg gmail.com

It was an old problem, than it was fixed, currently `emplaceRef` breaks it
import std.array;

void main()
    const Object[] arr;
...\src\phobos\std\conv.d(3914): Error: cannot implicitly convert expression
(arg) of type const(Object) to object.Object
...\src\phobos\std\array.d(54): Error: template instance
std.conv.emplaceRef!(const(Object)).emplaceRef!(const(Object)) error
main.d(6):        instantiated from here: array!(const(Object)[])

Jun 13 2014