view run/f/foreach_38_C.d @ 1586:a74f0139fc3d

Fix tests using typeof on types.
author Christian Kamm <kamm incasoftware de>
date Thu, 21 Aug 2008 15:42:21 +0200
parents 22767ec83a24
children
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	 Frits van Bommel <fvbommel@wxs.nl>
// @date@	2007-02-06
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=932
// @desc@	[Issue 932] static foreach in second template instantiation uses wrong tupleof

module dstress.run.f.foreach_38_C;

void Fields(C)(){
	foreach(i, a; typeof(C.tupleof)){
		static assert(is(a == typeof(C.tupleof)[i]));
	}
}

struct MyStruct1 {
	int afield;
}

struct MyStruct2 {
	real afield;
}

int main(){
	Fields!(MyStruct2);
	return 0;
}