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

          Issue ID: 13151
           Summary: std.range.take template constraint ambiguity
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nob...@puremagic.com
          Reporter: john.loughran.col...@gmail.com

unittest
{
    auto r = take(repeat(1, 4), 3);
    assert(r.equal(repeat(1, 3)));
}

fails to compile due to typeof(r) satisfying both

isInputRange!(Unqual!R) && !isInfinite!(Unqual!R) && hasSlicing!(Unqual!R) 

and

is(R T == Take!T)


Note that this isn't triggered by using an array. is(typeof(take(slice)) ==
typeof(slice))

--

Reply via email to