Open
Description
The doc explicitly says that this opcode can appear only a callvirt
instruction:
The
constrained
prefix is permitted only on acallvirt
instruction.
But according to sharplab the following:
public interface ITestable {
public abstract static void Test();
}
public class MyTester<T> where T : ITestable {
public void RunTest() {
T.Test();
}
}
Leads to the following IL:
.method public hidebysig
instance void RunTest () cil managed
{
// Method begins at RVA 0x208e
// Code size 12 (0xc)
.maxstack 8
IL_0000: constrained. !T
IL_0006: call void ITestable::Test()
IL_000b: ret
} // end of method MyTester`1::RunTest
Assuming that sharplab is right and this is intended behaviour it seems that update for docs can be needed.