http://d.puremagic.com/issues/show_bug.cgi?id=5371
Summary: ambiguous stringnize of class with alias this Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: k.hara...@gmail.com --- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2010-12-24 16:24:10 PST --- We can't compile this code if enable the line:26 or line:34. ---- import std.array; import std.format; class C1 { const(string) var = "C1"; alias var this; } class C2 { string var = "C2"; alias var this; } void main() { FormatSpec!char f; auto a = appender!string(); auto c1 = new C1(); auto c2 = new C2(); // formatValue(a, c1, f); // line:21 /* If enable this line, test.d(21): Error: template std.format.formatValue(Writer,T,Char) if (is(const(T) == const(void[]))) formatValue(Writer,T,Char) if (is(const(T) == const(void[]) )) matches more than one template declaration, C:\d\dmd2\src\phobos\std\format.d(1092):formatValue(Writer,T,Char) if (isSomeString!(T) && !isStaticArray!(T)) an d C:\d\dmd2\src\phobos\std\format.d(1346):formatValue(Writer,T,Char) if (is(T == class) && !isInputRange!(T)) */ // formatValue(a, c2, f); // line:29 /* If enable this line, C:\d\dmd2\src\phobos\std\format.d(1097): Error: test.C2 cannot be sliced with [] */ } ---- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------