Summary: std.array.insert on string[]
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from 2010-09-05 09:14:13 PDT ---
This D2 program correctly inserts the int 10 at the first position of an empty
array (dmd 2.048):

import std.array: insert;
void main() {
    int[] a;
    a.insert(0, 10);
    assert(a == [10]);

But a similar program doesn't work with an array of strings:

import std.array: insert;
void main() {
    string[] a;
    a.insert(0, "hello");

...\dmd\src\phobos\std\array.d(518): Error: cannot implicitly convert
expression (e) of type immutable(char) to string
...\dmd\src\phobos\std\array.d(14): Error: template instance
std.array.insert!(string,string) error instantiating

(A related necessary function std.array.remove is missing.)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to