Review Request 117551: Use function call sites to infer the type of their arguments

Sven Brauch svenbrauch at googlemail.com
Tue Apr 22 21:32:22 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117551/#review56228
-----------------------------------------------------------

Ship it!


Sorry, I had totally overlooked this patch somehow. You have to poke me if I don't review your stuff! ;)
Looks good, I'm not sure of the approach re-creating the function type for each encountered call, but I can't claim that python's version of updating it all the time works that great so let's try it.


duchain/declarationbuilder.cpp
<https://git.reviewboard.kde.org/r/117551/#comment39306>

    I personally like it better if you do the reverse check and do an early return if possible. Otherwise the indent level likes to get really large and that makes stuff hard to read ...


- Sven Brauch


On April 13, 2014, 7:23 p.m., Denis Steckelmacher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117551/
> -----------------------------------------------------------
> 
> (Updated April 13, 2014, 7:23 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-qmljs
> 
> 
> Description
> -------
> 
> When a function is called, the type of the parameters passed to it is used to update the type of the function (as seen from the outside, for instance "function void (string)") and the type of its parameters as seen from the inside (the declaration of "param1" of type "string").
> 
> The changes of this patch are limited to DeclarationBuilder (plus a unit test), but the code is fairly complex because it has to ensure that the proper number of arguments are being passed to the function (if it is not the case, then these arguments should not be used to update the function's type). Moreover, the type of the function must be entirely re-created, as FunctionType has no way of modifying the type if the arguments once it has been created (there is an arguments() method, but modifying the types there doesn't change the FunctionType itself).
> 
> 
> Diffs
> -----
> 
>   tests/files/helloworld.js a746b48 
>   duchain/declarationbuilder.h 395ab75 
>   duchain/declarationbuilder.cpp 55ad2e0 
> 
> Diff: https://git.reviewboard.kde.org/r/117551/diff/
> 
> 
> Testing
> -------
> 
> An unit test has been added. It checks that the types are correctly deduced and that DeclarationBuilder doesn't crash on malformed input.
> 
> 
> Thanks,
> 
> Denis Steckelmacher
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140422/001b7c4a/attachment-0001.html>


More information about the KDevelop-devel mailing list