class IntValue
{
    int x = 5;
}

class Foo
{
    IntValue val = new IntValue();
}

void main()
{
    Foo f1 = new Foo();
    Foo f2 = new Foo();

    assert(f1.val == f2.val);
}


Is this expected? Or should each Foo have their own IntValue object? They're equal right now, changing one changes the other. When exactly is the "new IntValue" happening? On program init, or when calling new Foo() for the first time?

Reply via email to