annotate run/overload_15.d @ 259:55f5fa58d38e

function overloading / resolving Nick Sabalausky <z@a.a> 2005-02-01 news:ctpknf$21se$1@digitaldaemon.com nntp://news.digitmars.com/digitalmars.D.bugs
author thomask
date Thu, 03 Feb 2005 03:55:43 +0000
parents
children 52c9e86b6486
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
259
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
1 // $HeadURL$
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
2 // $Date$
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
3 // $Author$
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
4
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
5 // @author@ Nick Sabalausky <z@a.a>
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
6 // @date@ 2005-02-01
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
7 // @uri@ news:ctpknf$21se$1@digitaldaemon.com
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
8 // @url@ nntp://news.digitmars.com/digitalmars.D.bugs
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
9
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
10 module dstress.run.overload_15;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
11
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
12 int status;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
13
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
14 void check(int x){
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
15 status++;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
16 }
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
17
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
18 class MyClass{
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
19 void test(){
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
20 assert(status==0);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
21 .check(0);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
22 assert(status==1);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
23 check();
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
24 assert(status==3);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
25 }
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
26
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
27 void check(){
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
28 assert(status==1);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
29 status+=2;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
30 }
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
31 }
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
32
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
33 int main(){
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
34 MyClass c = new MyClass();
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
35 assert(status==0);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
36 c.test();
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
37 assert(status==3);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
38 check(0);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
39 assert(status==4);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
40 return 0;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
41 }