Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Port PR from PTVS: https://github.com/Microsoft/PTVS/pull/4716 #115

Merged
merged 1 commit into from
Sep 23, 2018

Conversation

AlexanderSher
Copy link
Contributor

From @lostmsu:

This change fixes microsoft/PTVS#4715

Rationale:
If class A(B), and both have method foo, then any variable v of type B can potentially hold value of type A. Which means, that v.foo() can return a value of type that of return value of A.foo or B.foo.

To achieve that, when function return type is determined by DDG, it is also added as a potential return type for all of the function's bases (e.g. functions, that this function overrides).

In addition to that, this change also improves DDG.LookupBaseMethods, which previously only took into account built-in classes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty methods with @abc.abstractmethod and @abc.abstractproperty should infer type based on derived classes
2 participants