The representation is described in §23.1.10 Flags for methods [MethodAttributes], as VtableLayoutMask
. When the mask is applied to the attributes, the result will be either ReuseSlot
or NewSlot
. ReuseSlot
corresponds to the override
keyword in C#, and NewSlot
corresponds to the lack of override
keyword or a method explicitly marked with new
.
Hiding and overriding are different concepts. For example, if a method Foo
in class X
overrides a method of the same name in BaseX
, then X.Foo
also hides BaseX
.
Now for the specific 2 questions in the original post:
If the CIL definition is not marked
newslot
, then if a methodB.M
hidesA.M
thenB.M
will also overrideA.M
. (Partition II, §10.3.1)Partition II, §10.3.2 states the following (emphasis mine):
The remaining information specifies the virtual method that provides the implementation.
Combined with §15.4.2.2, it's clear that the
.override
directive can only refer to a method which is explicitly markedvirtual
.