Get more possible types when subscripting.
ClosedPublic

Authored by flherne on Nov 20 2016, 1:41 PM.

Details

Summary

Before, foo[a] would only consider one possible type of foo.
Loop over all possible types and combine the values for each.

This requires https://phabricator.kde.org/D3422 to apply cleanly, but isn't closely tied to it.

Test Plan

No test regressions. Adds three new tests, two of which fail without this patch.

Tried it on a few of my projects, it didn't crash.

Diff Detail

Repository
R53 KDevelop: Python Support
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
flherne updated this revision to Diff 8330.Nov 20 2016, 1:41 PM
flherne retitled this revision from to Get more possible types when subscripting..
flherne updated this object.
flherne edited the test plan for this revision. (Show Details)
flherne added a reviewer: brauch.
flherne set the repository for this revision to R53 KDevelop: Python Support.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptNov 20 2016, 1:41 PM
brauch accepted this revision.Nov 20 2016, 3:22 PM
brauch edited edge metadata.

Looks good to me, good feature as well. Thanks once more!

duchain/expressionvisitor.cpp
373

You could replace this whole if/else by auto valueTypes = Helper::filterType(type, []() { return true; }); if you wanted.

By the way, feel free to replace any QList you find anywhere by QVector ... it's a relict.

This revision is now accepted and ready to land.Nov 20 2016, 3:22 PM
This revision was automatically updated to reflect the committed changes.