changeset 1524:b5f3f03b37ad

[Issue 1113] Mixin causes incorrect static if branching Reiner Pope <reiner.pope@gmail.com> 2007-04-08 http://d.puremagic.com/issues/show_bug.cgi?id=1113
author thomask
date Fri, 27 Apr 2007 17:27:11 +0000
parents 8a8d5cb8775c
children ce8c04d69094
files compile/m/mixin_35_A.d compile/m/mixin_35_B.d compile/m/mixin_35_C.d compile/m/mixin_35_D.d
diffstat 4 files changed, 82 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/m/mixin_35_A.d	Fri Apr 27 17:27:11 2007 +0000
@@ -0,0 +1,21 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Reiner Pope <reiner.pope@gmail.com>
+// @date@	2007-04-08
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1113
+// @desc@	[Issue 1113] Mixin causes incorrect static if branching
+
+module dstress.compile.m.mixin_35_A;
+
+template Foo(){
+	mixin("alias char[] TheType;");
+
+	static if (is(TheType : char[]))
+		const int Bar = 13;
+	else
+		static assert(false);
+}
+
+static assert(13 == Foo!().Bar);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/m/mixin_35_B.d	Fri Apr 27 17:27:11 2007 +0000
@@ -0,0 +1,23 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Reiner Pope <reiner.pope@gmail.com>
+// @date@	2007-04-08
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1113
+// @desc@	[Issue 1113] Mixin causes incorrect static if branching
+
+module dstress.compile.m.mixin_35_B;
+
+template Foo(){
+	char[] dummy;
+
+	mixin("alias char[] TheType;");
+
+	static if (is(TheType : char[]))
+		const int Bar = 13;
+	else
+		static assert(false);
+}
+
+static assert(13 == Foo!().Bar);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/m/mixin_35_C.d	Fri Apr 27 17:27:11 2007 +0000
@@ -0,0 +1,21 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Reiner Pope <reiner.pope@gmail.com>
+// @date@	2007-04-08
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1113
+// @desc@	[Issue 1113] Mixin causes incorrect static if branching
+
+module dstress.compile.m.mixin_35_C;
+
+template Foo(){
+	alias char[] TheType;
+
+	static if (is(TheType : char[]))
+		const int Bar = 13;
+	else
+		static assert(false);
+}
+
+static assert(13 == Foo!().Bar);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/m/mixin_35_D.d	Fri Apr 27 17:27:11 2007 +0000
@@ -0,0 +1,17 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Reiner Pope <reiner.pope@gmail.com>
+// @date@	2007-04-08
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1113
+// @desc@	[Issue 1113] Mixin causes incorrect static if branching
+
+module dstress.compile.m.mixin_35_D;
+
+template Foo(){
+	mixin("alias char[] TheType;");
+	static assert(is(TheType : char[]));
+}
+
+mixin Foo!();