Mercurial > projects > dstress
changeset 1009:7d45295ced76
Can't refer to global scope after a cast
<lio@lunesu.com>
2006-05-18
news:bug-145-3@http.d.puremagic.com/bugzilla/
author | thomask |
---|---|
date | Fri, 19 May 2006 16:40:22 +0000 |
parents | f54eb4740885 |
children | 731f93c13ad6 |
files | run/o/opModule_01_A.d run/o/opModule_01_B.d |
diffstat | 2 files changed, 40 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opModule_01_A.d Fri May 19 16:40:22 2006 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <lio@lunesu.com> +// @date@ 2006-05-18 +// @uri@ news:bug-145-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.o.opModule_01_A; + +float foo(float f){ + return f + 1.0f; +} + +int main(){ + if(cast(int) .foo(2.0f) != 3){ + assert(0); + } + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opModule_01_B.d Fri May 19 16:40:22 2006 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <lio@lunesu.com> +// @date@ 2006-05-18 +// @uri@ news:bug-145-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.o.opModule_01_B; + +float foo(float f){ + return f + 1.0f; +} + +int main(){ + if(cast(int) (.foo(2.0f)) != 3){ + assert(0); + } + return 0; +}