What    |Removed                     |Added
                 CC|                            |

--- Comment #1 from 2012-10-21 06:37:26 PDT ---
Reduced test case. The the line of initialization of the 'b' variable matters.
If it's defined after bar() it compiles, otherwise it doesn't compile:

mixin template Foo() {
    static Spam[1] b = bar(); // Bad.
    static Spam[1] bar() {
        Spam[1] result;
        return result;
    // static Spam[1] b = bar(); // Good.
struct Spam {
    mixin Foo!();
void main() {}

Initializing 'b' before defining bar() gives the errors:

test.d(3): Error: function test.Spam.Foo!().bar circular dependency. Functions
cannot be interpreted while being compiled
test.d(2):        called from here: bar()
test.d(2):        called from here: bar()
test.d(10): Error: mixin test.Spam.Foo!() error instantiating

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to