Bug 14447 – adding isRandomAccessRange!S causes std.array unittests to fail to compile

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-14T03:45:48Z
Last change time
2024-12-13T18:42:09Z
Assigned to
No Owner
Creator
Walter Bright
See also
https://issues.dlang.org/show_bug.cgi?id=8521
Moved to GitHub: dmd#18974 →

Comments

Comment #0 by bugzilla — 2015-04-14T03:45:48Z
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.
Comment #1 by thomas.bockman — 2016-03-11T20:16:08Z
I have submitted a Phobos PR that works around this issue more cleanly: https://github.com/D-Programming-Language/phobos/pull/4072
Comment #2 by robert.schadek — 2024-12-13T18:42:09Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18974 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB