[Issue 15236] New: std.range.chain cannot chain a std.range.repeat string

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Oct 22 11:15:17 PDT 2015


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

          Issue ID: 15236
           Summary: std.range.chain cannot chain a std.range.repeat string
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: jack at jackstouffer.com

This seems to be a problem in the way the template constraint for chain finds
the element types for all of the ranges. It thinks that the element type for
Take!(Repeat!string) is string, so it comes up with CommonType!(string, dchar)
which is void.


-----------------------
import std.range;

void main()
{
    string a = "abc";
    string b = "xyz";
    chain(repeat(a, 2), b);
}

test.d(8): Error: template std.range.chain cannot deduce function from argument
types !()(Take!(Repeat!string), string)

--


More information about the Digitalmars-d-bugs mailing list