[Issue 711] New: combining mixins and overriding causes inifite loops

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 22 05:21:08 PST 2006


http://d.puremagic.com/issues/show_bug.cgi?id=711

           Summary: combining mixins and overriding causes inifite loops
           Product: D
           Version: 0.177
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn


(Originally posted by Chris Miller <chris at dprogramming.com>
on 2006-01-30 as news:op.s36xvez5po9bzi at moe)

#
# import std.stdio;
#
# template Mixer(){
#    void test(){
#       writefln("Mixer.test");
#    }
# }
#
# class Foo{
#    void test(){
#       writefln("Foo.test");
#    }
# }
#
# class Bar : Foo{
#    mixin Mixer!() mixer;
#
#    void test(){
#       writefln("Bar.test");
#       mixer.test();
#    }
# }
#
# void main(){
#    Bar f = new Bar();
#    f.test();
# }
#

output:
> Bar.test
> Bar.test
> Bar.test
> [...]

expected output:
> Bar.test
> Mixer.test

test cases:
http://dstress.kuehne.cn/run/m/mixin_16_A.d
http://dstress.kuehne.cn/run/m/mixin_16_B.d
http://dstress.kuehne.cn/run/m/mixin_16_C.d
http://dstress.kuehne.cn/run/m/mixin_16_D.d


-- 



More information about the Digitalmars-d-bugs mailing list