# HG changeset patch # User thomask # Date 1108203864 0 # Node ID b8b7a330468a26754c64af6721d3febffb2b6692 # Parent 8e103eba0fb42e99a12a9e5c48eb21c97642e1c9 with and opIndex Manfred Nowak 2005-02-03 news:cttuih$hpb$1@digitaldaemon.com nntp://news.digitalmars.com/digitalmars.D.bugs/2852 diff -r 8e103eba0fb4 -r b8b7a330468a run/with_12.d --- /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 +// @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 diff -r 8e103eba0fb4 -r b8b7a330468a run/with_13.d --- /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 +// @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