Show Type Hierarchy doesn't show subtypes
Code Snippet
class Base:
def method(self):
pass
class Derived(Base):
def method(self):
return super().method()
class Derived2(Base):
def method(self):
return super().method()
class Derived3(Derived, Derived2):
def method(self):
return super().method()
c = Derived2()
c.method()
Repro Steps
- place cursor on
Derived2and see type hierarchy, check subtypes and supertypes
Expected behavior
Both subtypes and supertypes are shown correctly. Specifically, when I click on c.method(), I expect it to show method in Derived3 as its subtype.
Actual behavior
No subtypes are shown.
Isn't this behavior (showing sub vs. super types) dependent on this toggle button?
@debonte yes, this is the show type hierarchy feature, not the show call hierarchy. Show type hierarchy is supposed to show both overriding method and overriden method, so in this case, I am expecting method in Derived3 to be shown as c.method's subtype.
Is that how it's supposed to work? Given that Derived2.method isn't a type, I wouldn't expect it to show overriding methods as subtypes. Maybe the bug here is that we shouldn't allow "Show Type Hierarchy" on non-type symbols?
Good point, this is just my interpretation of this pr.
@heejaechang might know it better. Regardless, I was expecting show supertype and subtype to behave consistently.