Create function type for lambda expressions.
ClosedPublic

Authored by flherne on Dec 1 2016, 12:47 AM.

Details

Summary

BUG: 306212
Lambda expressions were given the type of their return expression, e.g. lambda x: 12 has type "int".

That caused calling them to get no or an incorrect return type:
a = (lamba x: 12)("arg") # a should be int, but is mixed.

They should have a function type instead.

Test Plan

Fixes one test. No test regressions.

TODO: Add more tests, stress-testing on real projects. It's after midnight here, too...

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 8656.Dec 1 2016, 12:47 AM
flherne retitled this revision from to Create function type for lambda expressions..
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 TranscriptDec 1 2016, 12:47 AM
This revision was automatically updated to reflect the committed changes.