# HG changeset patch # User thomask # Date 1177694831 0 # Node ID b5f3f03b37ad2eb04aaddfc916025709c27958dc # Parent 8a8d5cb8775c696c482fa81005d247a455e9a530 [Issue 1113] Mixin causes incorrect static if branching Reiner Pope 2007-04-08 http://d.puremagic.com/issues/show_bug.cgi?id=1113 diff -r 8a8d5cb8775c -r b5f3f03b37ad compile/m/mixin_35_A.d --- /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 +// @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); diff -r 8a8d5cb8775c -r b5f3f03b37ad compile/m/mixin_35_B.d --- /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 +// @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); diff -r 8a8d5cb8775c -r b5f3f03b37ad compile/m/mixin_35_C.d --- /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 +// @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); diff -r 8a8d5cb8775c -r b5f3f03b37ad compile/m/mixin_35_D.d --- /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 +// @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!();