On Sunday, 28 January 2018 at 06:25:51 UTC, Shachar Shemesh wrote:
What will the following code print? Do not use the compiler:

import std.stdio;

struct A {
        int a = 1;

        void initialize() {
                a = a.init;
        }
}

void main() {
        A a;
        a.initialize();

        writeln(a.a);
}

I find this behavior unexpected.

Works exactly as I predicted.

Reply via email to