[Issue 14910] New: Take!R does not offer length for char[]

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Aug 12 01:39:57 PDT 2015


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

          Issue ID: 14910
           Summary: Take!R does not offer length for char[]
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: schneider.cedric at gmx.de

unittest
{
    char[] chars = ['h', 'e', 'l', 'l', 'o'];
    assert(chars.take(2).length == 2);
}

This unittest fails to compile, complaining that Take!char[] does not have a
length, despite Take!R claiming to offer a length property if the input range
does.

--


More information about the Digitalmars-d-bugs mailing list