On Monday, 10 February 2020 at 18:18:16 UTC, JN wrote:
Is this expected?

Yes, it is per the spec, though new users find it weird. Maybe we should change this but any static initializer is run at CTFE. Then the *static pointer* is put into the static initializer, which is just copied over before the constructor.

So it ends up being an instance reference to a static object.

If you want a new one, call `new Foo` in a regular constructor.


Reply via email to