If I declare a class as internal, why does the IL show it as private?
internal class Thing
.class private auto ansi beforefieldinit Thing.Thing
exten
From IL's point of view, private
means private to the assembly, i.e. internal
in C#.
In C#, it is not possible to mark types as private
if they are not nested. IL's equivalent accessibility for such types is nested private
.
So we have:
internal
-> IL's private
(to the assembly)private
-> IL's nested private
(to the enclosing type)