diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/scope_01.d	Sat Sep 25 22:33:30 2004 +0000
@@ -0,0 +1,40 @@
+// $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;
+}