It's a compiler generated name - the <>
characters are legal for identifiers in IL, but not in C#. So, the compiler knows it can generate names containing such characters without any chance that the name will conflict with a name you've used in your code.
In this particular case, <>g__initLocal0
is a new variable that has been introduced to hold a newly constructed instance of a class which is being initialized using initializer syntax. The original code was:
sampleClass = new SampleClass() { X = 5, Y = 10};
It's introduced to avoid sampleClass
being observed with the partially constructed instance - after new SampleClass()
has executed but before the assignments to X
and Y
occur. I.e. if Y = 10
throws an exception, it ensures that sampleClass
remains null
and not a new SampleClass
with X
set to 5 and some unknown value for Y
.