[Issue 11720] New: tupleof inconsistency
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Dec 10 16:55:49 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11720
Summary: tupleof inconsistency
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: critical
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: timothee.cour2 at gmail.com
--- Comment #0 from Timothee Cour <timothee.cour2 at gmail.com> 2013-12-10 16:55:31 PST ---
import std.stdio;
void main(){
struct A{
int x;
int x2;
}
A a;
fun(a);
}
void fun(T)(T a){
foreach(i, member; a.tupleof) {
static temp=a.tupleof[i].stringof;
string name = a.tupleof[i].stringof[2..$];
writeln(i," ",temp," ",name);//prints 0 a.x x then 1 a.x x2
assert(name==temp[2..$]);//fails
}
}
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list