changeset 1274:fa5b19cd8877

Error: (dg).ptr is not an lvalue Kirk McDonald <kirklin.mcdonald@gmail.com> 2006-12-17 http://d.puremagic.com/issues/show_bug.cgi?id=696
author thomask
date Sat, 23 Dec 2006 16:12:28 +0000
parents 7b911baa249b
children a00c90d4303d
files run/p/ptr_12_A.d
diffstat 1 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/p/ptr_12_A.d	Sat Dec 23 16:12:28 2006 +0000
@@ -0,0 +1,39 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Kirk McDonald <kirklin.mcdonald@gmail.com>
+// @date@	2006-12-17
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=696
+// @desc@	Error: (dg).ptr is not an lvalue
+
+module dstress.run.p.ptr_12_A;
+
+uint status;
+
+class A {
+	void foo(){
+		status += 4;
+	}
+}
+
+int main() {
+	A a = new A();
+	void delegate() dg;
+
+	dg.ptr = a;
+	dg.funcptr = &A.foo;
+
+	if(status != 0){
+		assert(0);
+	}
+
+	dg();
+
+	if(status != 4){
+		assert(0);
+	}
+
+	return 0;
+}
+