Mercurial > projects > ldc
annotate tests/mini/compile_delegatetuple.d @ 772:cd7da2ba14d1
Fix bug reported by downs. Related to delegate types within tuple template parameters.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 18 Nov 2008 17:14:57 +0100 |
parents | |
children |
rev | line source |
---|---|
kamm@772 | 1 alias char[] string; |
kamm@772 | 2 template Unstatic(T) { alias T Unstatic; } |
kamm@772 | 3 template Unstatic(T: T[]) { alias T[] Unstatic; } |
kamm@772 | 4 template StupleMembers(T...) { |
kamm@772 | 5 static if (T.length) { |
kamm@772 | 6 const int id=T[0..$-1].length; |
kamm@772 | 7 const string str=StupleMembers!(T[0..$-1]).str~"Unstatic!(T["~id.stringof~"]) _"~id.stringof~"; "; |
kamm@772 | 8 } else const string str=""; |
kamm@772 | 9 } |
kamm@772 | 10 |
kamm@772 | 11 struct Stuple(T...) { |
kamm@772 | 12 mixin(StupleMembers!(T).str); |
kamm@772 | 13 } |
kamm@772 | 14 Stuple!(string, void delegate(float)) foo; |