Very basic property getter support
ClosedPublic

Authored by flherne on Jan 19 2017, 7:11 PM.

Details

Summary

Just replace property functions with their return type in ExpressionVisitor::visitCall().

This only works for getter-only properties - if there's a setter function for the property (which idiomatically has the same name), visitCall() finds that declaration instead and gives the wrong return type.

Still, it's useful in a good proportion of cases.

To make this work properly, I think we need a specific declaration type for properties, and to update that when visiting the getter/setter instead of creating the function declarations directly in the class?

Test Plan

One new test fail->pass.
Two new tests still fail.
No test regressions.

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 10365.Jan 19 2017, 7:11 PM
flherne retitled this revision from to Very basic property getter support.
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 TranscriptJan 19 2017, 7:11 PM

Duchainified this on python and pypy codebases, it seems stable.

This revision was automatically updated to reflect the committed changes.