changeset 732:d57c3dc1b36e

Garett Bass <garettbass@studiotekne.com> 2005-11-02 news:dkb749$edg$1@digitaldaemon.com
author thomask
date Mon, 07 Nov 2005 01:06:34 +0000
parents c56770fab949
children 476575c64be3
files run/t/template_class_12_A.d run/t/template_class_12_B.d
diffstat 2 files changed, 78 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/t/template_class_12_A.d	Mon Nov 07 01:06:34 2005 +0000
@@ -0,0 +1,39 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Garett Bass <garettbass@studiotekne.com>
+// @date@	2005-11-02
+// @uri@	news:dkb749$edg$1@digitaldaemon.com
+
+module dstress.run.t.template_class_12_A;
+
+class Outer {
+	int x;
+	
+	abstract class AbstractInner {
+		void f();
+	}
+
+	class Inner : AbstractInner {
+		void f(){
+			x--;
+		}
+	}
+
+	this() {
+		AbstractInner c = new Inner();
+		assert(x==0);
+		c.f();
+		assert(x==-1);
+	}
+}
+
+int main(){
+	Outer o = new Outer();
+	assert(o.x == -1);
+	return 0;
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/t/template_class_12_B.d	Mon Nov 07 01:06:34 2005 +0000
@@ -0,0 +1,39 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Garett Bass <garettbass@studiotekne.com>
+// @date@	2005-11-02
+// @uri@	news:dkb749$edg$1@digitaldaemon.com
+
+module dstress.run.t.template_class_12_B;
+
+class Outer {
+	int x;
+	
+	abstract class AbstractInner {
+		void f();
+	}
+
+	class Inner(int i) : AbstractInner {
+		void f(){
+			x-=i;
+		}
+	}
+
+	this() {
+		AbstractInner c = new Inner!(2)();
+		assert(x==0);
+		c.f();
+		assert(x==-2);
+	}
+}
+
+int main(){
+	Outer o = new Outer();
+	assert(o.x == -2);
+	return 0;
+}
+
+
+