changeset 1562:539ede0215a4

r8715@birke: tk | 2007-09-29 23:52:45 +0200 [Issue 1534] Can't mix in a case statement. <aziz.kerim@gmail.com> 2007-09-26 http://d.puremagic.com/issues/show_bug.cgi?id=1534
author thomask
date Sun, 30 Sep 2007 09:44:14 +0000
parents 24fcb78d93f6
children 17cb36e8f9ae
files run/m/mixin_37_A.d run/m/mixin_37_B.d
diffstat 2 files changed, 66 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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@	<aziz.kerim@gmail.com>
+// @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;
+}
--- /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@	<aziz.kerim@gmail.com>
+// @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;
+}