changeset 281:b8b7a330468a

with and opIndex Manfred Nowak <svv1999@hotmail.com> 2005-02-03 news:cttuih$hpb$1@digitaldaemon.com nntp://news.digitalmars.com/digitalmars.D.bugs/2852
author thomask
date Sat, 12 Feb 2005 10:24:24 +0000
parents 8e103eba0fb4
children 81fdb31f5960
files run/with_12.d run/with_13.d
diffstat 2 files changed, 58 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/with_12.d	Sat Feb 12 10:24:24 2005 +0000
@@ -0,0 +1,26 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Manfred Nowak <svv1999@hotmail.com>
+// @date@	2005-02-03
+// @uri@	news:cttuih$hpb$1@digitaldaemon.com
+// @url@	nntp://news.digitalmars.com/digitalmars.D.bugs/2852
+
+module dstress.run.with_12;
+
+struct Entry{
+	int a;
+}
+
+int main(){
+	Entry[10] table;
+
+	assert(table[1].a==0);
+	with( table[1]){
+		a=1;
+	}
+	assert(table[1].a==1);
+
+	return 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/with_13.d	Sat Feb 12 10:24:24 2005 +0000
@@ -0,0 +1,32 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Manfred Nowak <svv1999@hotmail.com>
+// @date@	2005-02-03
+// @uri@	news:cttuih$hpb$1@digitaldaemon.com
+// @url@	nntp://news.digitalmars.com/digitalmars.D.bugs/2852
+
+module dstress.run.with_13;
+
+class Class{
+	struct Entry{
+		int a;
+	}
+	
+	Entry[10] table;
+	
+	Entry opIndex(int i){
+		return table[i];
+	}
+}
+
+int main(){
+	Class c= new Class;
+
+	with( c[ 1]){
+		a=0;
+	}
+
+	return 0;
+}
\ No newline at end of file