# HG changeset patch # User thomask # Date 1169559974 0 # Node ID 54d2cf6154ba956dd7c333977de68b1d28ac68cb # Parent 0839eb936902427cf2adcf20d38bc5d1aa962c9a [Issue 873] Scope dependant compilation error Boris Kolar 2007-01-23 http://d.puremagic.com/issues/show_bug.cgi?id=873 diff -r 0839eb936902 -r 54d2cf6154ba run/m/mixin_26_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/m/mixin_26_A.d Tue Jan 23 13:46:14 2007 +0000 @@ -0,0 +1,32 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Boris Kolar +// @date@ 2007-01-23 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=873 +// @desc@ [Issue 873] Scope dependant compilation error + +module dstress.run.m.mixin_26_A; + +template Factory() { + Foo bar() { + return Foo.init; + } +} + +struct Foo { + mixin Factory!(); + int i = 0x12_34_FF_AA; +} + +int main() { + Foo f; + if(f.bar() != Foo.init){ + assert(0); + } + + if(f.bar().i == 0x12_34_FF_AA){ + return 0; + } +} diff -r 0839eb936902 -r 54d2cf6154ba run/m/mixin_26_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/m/mixin_26_B.d Tue Jan 23 13:46:14 2007 +0000 @@ -0,0 +1,32 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Boris Kolar +// @date@ 2007-01-23 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=873 +// @desc@ [Issue 873] Scope dependant compilation error + +module dstress.run.m.mixin_26_B; + +template Factory() { + Foo bar() { + return Foo.init; + } +} + +int main() { + struct Foo { + mixin Factory!(); + int i = 0x12_34_FF_AA; + } + + Foo f; + if(f.bar() != Foo.init){ + assert(0); + } + + if(f.bar().i == 0x12_34_FF_AA){ + return 0; + } +}