diff options
Diffstat (limited to 'gcc/testsuite/gdc.test/runnable/aliasassign.d')
-rw-r--r-- | gcc/testsuite/gdc.test/runnable/aliasassign.d | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/runnable/aliasassign.d b/gcc/testsuite/gdc.test/runnable/aliasassign.d new file mode 100644 index 00000000000..986cccc4db8 --- /dev/null +++ b/gcc/testsuite/gdc.test/runnable/aliasassign.d @@ -0,0 +1,31 @@ + + +template AliasSeq(T...) { alias AliasSeq = T; } + +template staticMap(alias F, T...) +{ + alias A = AliasSeq!(); + static foreach (t; T) + A = AliasSeq!(A, F!t); + alias staticMap = A; +} + +template Qual(alias T) +{ + alias Qual = T; +} + +void test() +{ + int x = 3; + int y = 4; + + alias XY = staticMap!(Qual, x, y); + assert(XY[0] == 3); + assert(XY[1] == 4); +} + +void main() +{ + test(); +} |