[Issue 2514] New: indexing error in struct.tupleof[i]
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Dec 13 12:33:54 PST 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2514
Summary: indexing error in struct.tupleof[i]
Product: D
Version: 1.036
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: shro8822 at vandals.uidaho.edu
template Foo(T, uint n = 0)
{
static if(T.tupleof.length <= n) const char[] Foo = "";
else const char[] Foo = typeof(T.tupleof[n]).stringof ~ " " ~ Foo!(T,n+1);
}
import std.stdio;
void main()
{
writef("%d, %s\n", __VERSION__, Foo!(S)); /// generates "int, int, int"
}
struct S { int i; uint j; float k; }
for this, the following is a work around:
- else const char[] Foo = typeof(T.tupleof[n]).stringof ~ " " ~ Foo!(T,n+1);
+ else const char[] Foo = typeof(T.tupleof)[n].stringof ~ " " ~ Foo!(T,n+1);
--
More information about the Digitalmars-d-bugs
mailing list