www.digitalmars.com         C & C++   DMDScript  

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

https://issues.dlang.org/show_bug.cgi?id=12911

          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
again:
---
import std.array;

void main()
{
    const Object[] arr;
    arr.array();
}
---
...\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
instantiating
main.d(6):        instantiated from here: array!(const(Object)[])
---

--
Jun 13 2014