I recently worked in a Microsoft.Ink dll using C # and debugging the problem (which is not related to this). I noticed that when I debugged it, the ink objects had a strokes object in which there was an ink object that had .... etc.
This confused me, since I was on the assumption that you could not do this (I come from the background in C ++)
But I ignored this, solved the problem and moved on. Today I have a similar problem, as I look at a class that had a private member, which was the same class as itself.
public sealed class Factory
{
private static Factory instance = new Factory();
}
How is this possible? Now I can call instance.instance.instance.instance ... etc. This, as you can imagine, harms my death brain, and I’m sure that it cannot be good on a computer either. How does the compiler handle this? And how deep is the rabbit hole?
source
share