# HG changeset patch # User thomask # Date 1107402943 0 # Node ID 55f5fa58d38ee605c474d483770a4f6c0f2c9ee7 # Parent 8cff0c780abb3a59f355e6a17de16a734e1a2200 function overloading / resolving Nick Sabalausky 2005-02-01 news:ctpknf$21se$1@digitaldaemon.com nntp://news.digitmars.com/digitalmars.D.bugs diff -r 8cff0c780abb -r 55f5fa58d38e run/overload_14.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/overload_14.d Thu Feb 03 03:55:43 2005 +0000 @@ -0,0 +1,41 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick Sabalausky +// @date@ 2005-02-01 +// @uri@ news:ctpknf$21se$1@digitaldaemon.com +// @url@ nntp://news.digitmars.com/digitalmars.D.bugs + +module dstress.run.overload_14; + +int status; + +void check(int x){ + status++; +} + +class MyClass{ + void test(){ + assert(status==0); + check(0); + assert(status==1); + check(); + assert(status==3); + } + + void check(){ + assert(status==1); + status+=2; + } +} + +int main(){ + MyClass c = new MyClass(); + assert(status==0); + c.test(); + assert(status==3); + check(0); + assert(status==4); + return 0; +} diff -r 8cff0c780abb -r 55f5fa58d38e run/overload_15.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/overload_15.d Thu Feb 03 03:55:43 2005 +0000 @@ -0,0 +1,41 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick Sabalausky +// @date@ 2005-02-01 +// @uri@ news:ctpknf$21se$1@digitaldaemon.com +// @url@ nntp://news.digitmars.com/digitalmars.D.bugs + +module dstress.run.overload_15; + +int status; + +void check(int x){ + status++; +} + +class MyClass{ + void test(){ + assert(status==0); + .check(0); + assert(status==1); + check(); + assert(status==3); + } + + void check(){ + assert(status==1); + status+=2; + } +} + +int main(){ + MyClass c = new MyClass(); + assert(status==0); + c.test(); + assert(status==3); + check(0); + assert(status==4); + return 0; +} diff -r 8cff0c780abb -r 55f5fa58d38e run/overload_16.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/overload_16.d Thu Feb 03 03:55:43 2005 +0000 @@ -0,0 +1,41 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick Sabalausky +// @date@ 2005-02-01 +// @uri@ news:ctpknf$21se$1@digitaldaemon.com +// @url@ nntp://news.digitmars.com/digitalmars.D.bugs + +module dstress.run.overload_16; + +int status; + +void check(int x){ + status++; +} + +class MyClass{ + void test(){ + assert(status==0); + .check(0); + assert(status==1); + .check(); + assert(status==3); + } + + void check(){ + assert(status==1); + status+=2; + } +} + +int main(){ + MyClass c = new MyClass(); + assert(status==0); + c.test(); + assert(status==3); + check(0); + assert(status==4); + return 0; +}