The problem here is the issue of volume. We can learn more with breakpoints.
Here we stop before initializing reference1 .
All nil variables are expected:

And after initializing reference1 ?

Ok, skip ahead so that after reference2 and reference3 are set:

All three variables point to the same memory cell, and we see that the initializer works only once. They all point to the same location.
Take a step forward:

reference1 now points to None . This is nil . deinit mmethod was not called and did not print his message.
Take a step further:

Now reference1 and reference2 both expected nil . The println statements that I added were called. But deinit did not execute, and reference3 not nil .
The next step is to move away from the method. When we exit the method, the variables go out of scope and are called by deinit :

source share