Bug 10997 – Tupple parsing(?)

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-08T08:52:57Z
Last change time
2020-03-21T03:56:36Z
Assigned to
No Owner
Creator
Shoo

Comments

Comment #0 by a401989 — 2013-09-08T08:52:57Z
These two code snippets should be equivalent: (http://dpaste.dzfl.pl/092d6296) ----------------------------- import std.typecons; struct Point { int x, y, z; Tuple!(string, Point) foo() { return tuple("foo", this); } } void main() {} ----------------------------- http://dpaste.dzfl.pl/44e95825 ----------------------------- import std.typecons; alias Tuple!(string, Point) DirPoint; struct Point { int x, y, z; DirPoint foo() { return tuple("foo", this); } } void main() {} ----------------------------- Alas later one fails horribly with /d954/f796.d(3): Error: alias f796.DirPoint recursive alias declaration /opt/compilers/dmd2git/include/std/range.d(611): Error: static assert "Cannot put a char[] into a Appender!(string)" /opt/compilers/dmd2git/include/std/format.d(1436): instantiated from here: put!(Appender!(string), char[]) /opt/compilers/dmd2git/include/std/format.d(1338): instantiated from here: formatUnsigned!(Appender!(string), char) /opt/compilers/dmd2git/include/std/format.d(1312): instantiated from here: formatIntegral!(Appender!(string), ulong, char) /opt/compilers/dmd2git/include/std/format.d(2953): ... (3 instantiations, -v to show) ... /opt/compilers/dmd2git/include/std/typecons.d(326): instantiated from here: format!(char, ulong,ulong) /d954/f796.d(3): instantiated from here: Tuple!(string, Point)