Mercurial > projects > dstress
view run/scope_01.d @ 0:3269e4627918
init dstress
author | svnowner |
---|---|
date | Sat, 25 Sep 2004 22:33:30 +0000 |
parents | |
children | 3414705c41ac |
line wrap: on
line source
// $Header: /home/th/Dokumente/Entwicklung/MEIN_CVS/MiniD/src/run/scope_01.d,v 1.1 2004/08/21 21:38:30 th Exp $ // @author@ J Anderson <REMOVEanderson@badmama.com.au> // @date@ 2004-01-05 // @uri@ news://c70jk9$off$1@digitaldaemon.com int check; class MyClass{ this(){ status=3; } void call(){ assert(status==3); s.test(); check+=5; } struct MyStruct{ void test(){ assert(status==3); status=4; check+=3; } } MyStruct s; int status; } int main(){ MyClass c = new MyClass(); assert(c.status==3); assert(check==0); c.call(); assert(c.status==4); assert(check==8); return 0; }