可能重复: Why is the C# compiler emitting a callvirt instruction for a GetType() method call? 我看到,当我把一个类的实例方法的C#编译器发出 callvirt指令调用该方法,为什么会这样? 是否表示编译器将所有实例方法视为virtual methods,这有什么神秘之处?
让我们来看看一个基本类: class A
{
public function renderSomethingRecursive()
{
//this function can call itself
self::renderSomethingRecursive(); // ERROR!!!!
}
abstract public f