www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14447] New: adding isRandomAccessRange!S causes std.array

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

          Issue ID: 14447
           Summary: adding isRandomAccessRange!S causes std.array
                    unittests to fail to compile
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

This bug happens in compiling Phobos unittests. To reproduce:

1. edit std\utf.d and add the lines:

    pragma(msg, S);
    pragma(msg, isRandomAccessRange!S);

after the lines in the wchar overload of decodeImpl() that say:

    //   BUG    8521 forces this to be done outside of decodeImpl
    //enum canIndex = is(S : const wchar[]) || (isRandomAccessRange!S &&
hasSlicing!S && hasLength!S);

2. compile std\array.d for unittests with:

    dmd std\array -main -unittest

and you'll be greeted with:

dmd std\array -unittest -main
wchar[]
false
wstring
false
std\array.d(1543): Error: template std.array.split cannot deduce function from
argument types !()(wstring, string), candidates are:
std\array.d(1402):        std.array.split(S)(S s) if (isSomeString!S)
std\array.d(1508):        std.array.split(Range, Separator)(Range range,
Separator sep) if (isForwardRange!Range && is(typeof(ElementType!Range.init ==
Separator.init)))
std\array.d(1515):        std.array.split(Range, Separator)(Range range,
Separator sep) if (isForwardRange!Range && isForwardRange!Separator &&
is(typeof(ElementType!Range.init == ElementType!Separator.init)))
std\array.d(1522):        std.array.split(alias isTerminator, Range)(Range
range) if (isForwardRange!Range &&
is(typeof(unaryFun!isTerminator(range.front))))

Tested on Windows. Probably related to
https://issues.dlang.org/show_bug.cgi?id=8521, but I made it a separate issue
because this does not present with an ICE.

--
Apr 13 2015