# HG changeset patch # User thomask # Date 1175791034 0 # Node ID 85bd7d2ddb7dd4e786609734a19f34f7fd030f18 # Parent 22767ec83a24ab5bbd076c58ed5271200ae2c64e [Issue 933] Literal tuple parameters fails to compile when inout is mentioned Nick 2007-02-06 http://d.puremagic.com/issues/show_bug.cgi?id=933 diff -r 22767ec83a24 -r 85bd7d2ddb7d run/t/tuple_20_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/tuple_20_A.d Thu Apr 05 16:37:14 2007 +0000 @@ -0,0 +1,32 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick +// @date@ 2007-02-06 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=933 +// @desc@ [Issue 933] Literal tuple parameters fails to compile when inout is mentioned + +module dstress.run.t.tuple_20_A; + +int x; + +struct Foo(T...){ + void set(T t){ + x += t[0]; + } + + void get(inout T t){ + x *= t[0]; + } +} + +int main(){ + Foo!(int) foo; + foo.set(5); + if(5 != x){ + assert(0); + } + + return 0; +} diff -r 22767ec83a24 -r 85bd7d2ddb7d run/t/tuple_20_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/tuple_20_B.d Thu Apr 05 16:37:14 2007 +0000 @@ -0,0 +1,28 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick +// @date@ 2007-02-06 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=933 +// @desc@ [Issue 933] Literal tuple parameters fails to compile when inout is mentioned + +module dstress.run.t.tuple_20_B; + +int x; + +struct Foo(T...){ + void set(T t){ + x += t[0]; + } +} + +int main(){ + Foo!(int) foo; + foo.set(5); + if(5 != x){ + assert(0); + } + + return 0; +}