# HG changeset patch # User thomask # Date 1167575307 0 # Node ID eac3a538961acaa4c8b26b490c9b7f63274c1178 # Parent 721a83317b140ead5425cb890c7bf00bb2b1cb7a [Issue 772] Bogus error using relation operator as static if expression within template Chris Sauls 2006-12-30 http://d.puremagic.com/issues/show_bug.cgi?id=772 diff -r 721a83317b14 -r eac3a538961a compile/o/opCmp_09_A.d --- /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 +// @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); + diff -r 721a83317b14 -r eac3a538961a compile/o/opCmp_09_B.d --- /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 +// @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); + diff -r 721a83317b14 -r eac3a538961a nocompile/o/opCmp_09_C.d --- /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 +// @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; +} + diff -r 721a83317b14 -r eac3a538961a run/o/opCmp_09_D.d --- /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 +// @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; +} +