CODE:
void main()
{
import std.uni;
string a = "test";
auto b = a.byGrapheme;
}
$ dmd --version
DMD64 D Compiler v2.080.0
$ dmd -unittest -main -run source/yarn.d
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(7010): Error: forward reference to inferred return type of function call hangLV()
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(7040): Error: forward reference to inferred return type of function call hangLV()
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(7110): Error: template instance `std.uni.genericDecodeGrapheme!false.genericDecodeGrapheme!(const(char)[])` error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3206): instantiated from here: graphemeStride!char
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(2890): instantiated from here: formatRange!(Appender!string, string, char)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(1845): instantiated from here: formatValueImpl!(Appender!string, string, char)
/usr/local/opt/dmd/include/dlang/dmd/std/array.d(3268): ... (7 instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432): instantiated from here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502): instantiated from here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(1018): Error: template instance `std.conv.toStr!(string, char)` error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(222): instantiated from here: toImpl!(string, char)
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(4255): instantiated from here: to!char
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(4194): instantiated from here: textImpl!(string, string, char)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(486): ... (13 instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432): instantiated from here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502): instantiated from here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(4194): Error: template instance `std.conv.textImpl!(string, string, string, string)` error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(4509): instantiated from here: text!(string, string, string)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(4484): instantiated from here: getNth!("integer width", isIntegral, int, uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(492): instantiated from here: getNthInt!("integer width", uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3400): ... (12 instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432): instantiated from here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502): instantiated from here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(4484): Error: template instance `std.format.getNth!("integer precision", isIntegral, int, uint)` error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(518): instantiated from here: getNthInt!("integer precision", uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3400): instantiated from here: formattedWrite!(Appender!string, char, uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3496): instantiated from here: formatChar!(Appender!string)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3339): ... (10 instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432): instantiated from here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502): instantiated from here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(4484): Error: template instance `std.format.getNth!("separator digit width", isIntegral, int, uint)` error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(538): instantiated from here: getNthInt!("separator digit width", uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3400): instantiated from here: formattedWrite!(Appender!string, char, uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3496): instantiated from here: formatChar!(Appender!string)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3339): ... (10 instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432): instantiated from here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502): instantiated from here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(4194): Error: template instance `std.conv.textImpl!(string, string, string, string, string, uint)` error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(4503): instantiated from here: text!(string, string, string, string, uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(546): instantiated from here: getNth!("separator character", isSomeChar, dchar, uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3400): instantiated from here: formattedWrite!(Appender!string, char, uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3496): ... (11 instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432): instantiated from here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502): instantiated from here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(4194): Error: template instance `std.conv.textImpl!(string, string, ubyte, char, char, string, ulong)` error instantiating
Comment #1 by jack — 2018-05-03T15:32:09Z
Introduced in https://github.com/dlang/phobos/pull/6235
So, what's happening is that the toString of Appender now uses formatValue, which calls formatRange, which calls graphemeStride. Grapheme uses TrieBuilder, which uses std.conv.text for an error message which uses Appender, and you can see the problem.
Comment #2 by github-bugzilla — 2018-06-03T23:37:33Z