icsharpcode/ILSpy

When navigating to an overridden virtual method from the overriding derived class, navigate to the overridden method

Open

#819 建立於 2017年7月5日

在 GitHub 查看
 (1 留言) (2 反應) (0 負責人)C# (3,645 fork)batch import
Help WantedUI

倉庫指標

Star
 (25,162 star)
PR 合併指標
 (平均合併 15天 22小時) (30 天內合併 61 個 PR)

描述

Consider the following class structure:

class Base 
{
    public virtual int Foo() { return 42; }
}

sealed class Derived : Base
{
    public override int Foo() { return 123; }
    public int Bar() { return this.Foo(); }
}

Suppose I'm looking at Derived::Bar, and I click Foo(). I am currently taken to Base::Foo which is misleading because in actuality Derived::Foo will be called.

I made Derived sealed just to drive my point further, obviously even if it's non-sealed Derived::Foo would be a better guess.

貢獻者指南