To satisfy our technical curiosity, we would like to know how constructors are called when writing code as shown earlier. As you already know, constructors are special methods that cannot be called directly. Their special treatment reaches beyond the managed code language compilers, though. The runtime also needs to treat them specially because they are tightly coupled with memory-allocation mechanisms and such.
Let’s illustrate matters by using the ILDASM for the
TimeSpan constructor call, as shown in Figure 6.13.
Figure 6.13. A constructor call for a value type unraveled.
In fact, a few different cases for constructor ...