www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - mixin bug?

reply "shinichiro.h" <s31552 mail.ecc.u-tokyo.ac.jp> writes:
Hello,

The following codes cause error:

--- split.d

template Split() {
    void split() {
        Game.obj.addShot(new Shot());
    }
}

--- game.d

private import shot;
class Game {
    static Shot[] shots;
    static void addShot(Shot s) { shots ~= s; }
}

--- shot.d

private import game;
private import split;
class Shot {
    mixin Split;
}


The error message is

split.d(3): no property 'obj' for type 'Game'

I think mixin Split has module shot's scope. So they are not
wrong. And even if I add "private import game;" to split.d,
I met same error. Is it bug?

------------------
 shinichiro.h
Sep 03 2004
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
 split.d(3): no property 'obj' for type 'Game'
have you shortened your code? because there really doesn't seem to be an 'obj' property for Game.
Sep 04 2004
parent "shinichiro.h" <s31552 mail.ecc.u-tokyo.ac.jp> writes:
 have you shortened your code?  because there really doesn't seem to be an
 'obj' property for Game.
Oooops! I'm sorry. I'll reshorten my code and report again. ------------------ shinichiro.h
Sep 05 2004