changeset 465:e224de1ae026

mixin opCall Jarrett Billingsley <kb3ctd2@yahoo.com> 2005-03-23 news:d1sosj$cmo$1@digitaldaemon.com
author thomask
date Wed, 20 Apr 2005 19:47:10 +0000
parents 58cc6e103138
children fb12b778ea27
files run/mixin_12.d
diffstat 1 files changed, 45 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/mixin_12.d	Wed Apr 20 19:47:10 2005 +0000
@@ -0,0 +1,45 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Jarrett Billingsley <kb3ctd2@yahoo.com>
+// @date@	2005-03-23
+// @uri@	news:d1sosj$cmo$1@digitaldaemon.com
+
+module dstress.run.mixin_12;
+
+class A{
+	template M(){
+		int C(){
+			return 10;
+		}
+
+		int opCall(){
+			return 15;
+		}
+	}
+
+	mixin M m;
+
+	template N(){
+		int C(){
+			return 20;
+		}
+
+		int opCall(){
+			return 25;
+		}
+	}
+
+	mixin N n;
+}
+
+int main(){
+	A a=new A;
+	assert(a.m.C()==10);
+	assert(a.n.C()==20);
+
+	assert(a.m()==15);
+	assert(a.n()==25);
+	return 0;
+}