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)