# HG changeset patch # User thomask # Date 1191145454 0 # Node ID 539ede0215a4495e50574b3f4f9950c8a7f42ae9 # Parent 24fcb78d93f68d11312e839076110ceafb2f40e1 r8715@birke: tk | 2007-09-29 23:52:45 +0200 [Issue 1534] Can't mix in a case statement. 2007-09-26 http://d.puremagic.com/issues/show_bug.cgi?id=1534 diff -r 24fcb78d93f6 -r 539ede0215a4 run/m/mixin_37_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/m/mixin_37_A.d Sun Sep 30 09:44:14 2007 +0000 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-09-26 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1534 +// @desc@ [Issue 1534] Can't mix in a case statement. + +module dstress.run.m.mixin_37_A; + +int check(int i){ + switch(i){ + mixin("case 0:{ return 1;}"); + case 1, 2: + return 2; + default: + return 3; + } +} + +int main(){ + if(1 != check(0)){ + assert(0); + } + if(2 != check(1)){ + assert(0); + } + if(3 != check(-1)){ + assert(0); + } + return 0; +} diff -r 24fcb78d93f6 -r 539ede0215a4 run/m/mixin_37_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/m/mixin_37_B.d Sun Sep 30 09:44:14 2007 +0000 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-09-26 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1534 +// @desc@ [Issue 1534] Can't mix in a case statement. + +module dstress.run.m.mixin_37_B; + +int check(int i){ + switch(i){ + case 0:{ return 1; } + case 1, 2: + return 2; + default: + return 3; + } +} + +int main(){ + if(1 != check(0)){ + assert(0); + } + if(2 != check(1)){ + assert(0); + } + if(3 != check(-1)){ + assert(0); + } + return 0; +}