annotate run/opCatAssign_08.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents b8c0195059d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
356
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
1 // $HeadURL$
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
2 // $Date$
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
3 // $Author$
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
4
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
5 // @author@ Regan Heath <regan@netwin.co.nz>
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
6 // @date@ 2005-03-17
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 356
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3213
356
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
8
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
9 module dstress.run.opCatAssign_08;
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
10
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
11 int status;
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
12
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
13 class MyClass{
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
14 template opCatAssign(Type){
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
15 MyClass opCatAssign(Type arr){
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
16 status+=3;
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
17 return this;
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
18 }
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
19 }
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
20 mixin opCatAssign!(int[]);
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
21 }
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
22
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
23 int main(){
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
24 static int[] arr = [0,1,2];
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
25 MyClass a = new MyClass();
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
26
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
27 assert(status==0);
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
28 a ~= arr;
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
29 assert(status==3);
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
30 return 0;
a1f59b48d72c mixin opCatAssign
thomask
parents:
diff changeset
31 }