Mercurial > projects > dstress
diff run/opIndex_01.d @ 480:a3d84fdbfd53
-inline / opIndex / struct
Kevin Bealer <Kevin_member@pathlink.com>
2005-04-24
news:d4ha7g$fuc$1@digitaldaemon.com
author | thomask |
---|---|
date | Mon, 25 Apr 2005 05:43:26 +0000 |
parents | |
children | 1e6afb94ce6d |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/opIndex_01.d Mon Apr 25 05:43:26 2005 +0000 @@ -0,0 +1,36 @@ +// $HeadURI$ +// $Author$ +// $Date$ + +// @author@ Kevin Bealer <Kevin_member@pathlink.com> +// @date@ 2005-04-24 +// @uri@ news:d4ha7g$fuc$1@digitaldaemon.com + +// __DSTRESS_DFLAGS__ -inline + +module dstress.run.opIndex_01; + +struct Range{ + int width(){ + return 1; + } +} + +class Container { + Range opIndex(int i){ + return data[i]; + } + + Range[2] data; +} + +int main(){ + Container ranges=new Container; + + if (ranges[0].width == 1){ + return 0; + } + + assert(0); +} +