changeset 1312:eac3a538961a

[Issue 772] Bogus error using relation operator as static if expression within template Chris Sauls <ibisbasenji@gmail.com> 2006-12-30 http://d.puremagic.com/issues/show_bug.cgi?id=772
author thomask
date Sun, 31 Dec 2006 14:28:27 +0000
parents 721a83317b14
children f6001af60ca0
files compile/o/opCmp_09_A.d compile/o/opCmp_09_B.d nocompile/o/opCmp_09_C.d run/o/opCmp_09_D.d
diffstat 4 files changed, 90 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/o/opCmp_09_A.d	Sun Dec 31 14:28:27 2006 +0000
@@ -0,0 +1,19 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Chris Sauls <ibisbasenji@gmail.com>
+// @date@	2006-12-30
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=772
+// @desc@	[Issue 772] Bogus error using relation operator as static if expression within template
+
+module dstress.compile.o.opCmp_09_A;
+
+template Templ (ulong n) {
+	static if (n > 10_LU) {
+		static assert(0);
+	}
+}
+
+mixin Templ!(1_LU);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/o/opCmp_09_B.d	Sun Dec 31 14:28:27 2006 +0000
@@ -0,0 +1,19 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Chris Sauls <ibisbasenji@gmail.com>
+// @date@	2006-12-30
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=772
+// @desc@	[Issue 772] Bogus error using relation operator as static if expression within template
+
+module dstress.compile.o.opCmp_09_B;
+
+template Templ (ulong n) {
+	static if (n < 10_LU) {
+		const Templ = 9.8;
+	}
+}
+
+const a = Templ!(1_LU);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/o/opCmp_09_C.d	Sun Dec 31 14:28:27 2006 +0000
@@ -0,0 +1,27 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Chris Sauls <ibisbasenji@gmail.com>
+// @date@	2006-12-30
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=772
+// @desc@	[Issue 772] Bogus error using relation operator as static if expression within template
+
+// __DSTRESS_ELINE__ 23
+
+module dstress.nocompile.o.opCmp_09_C;
+
+template Templ (ulong n) {
+	static if (n < 10_LU) {
+		const Templ = 9.8;
+	}
+}
+
+int main(char[][] args){
+	long l = args.length;
+
+	auto a = Templ!(l);
+	
+	return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/o/opCmp_09_D.d	Sun Dec 31 14:28:27 2006 +0000
@@ -0,0 +1,25 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Chris Sauls <ibisbasenji@gmail.com>
+// @date@	2006-12-30
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=772
+// @desc@	[Issue 772] Bogus error using relation operator as static if expression within template
+
+module dstress.run.o.opCmp_09_D;
+
+template Templ (ulong n) {
+	static if (n < 10_LU) {
+		const Templ = 9.8;
+	}
+}
+
+int main(char[][] args){
+	const long l = 4;
+
+	auto a = Templ!(l);
+	
+	return 0;
+}
+