Review Request 117544: Use assignations to variables tu deduce their types

Sven Brauch svenbrauch at googlemail.com
Sun Apr 13 15:09:17 UTC 2014


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

Ship it!


Except for two nitpicks, go for it! Nice ;)


duchain/contextbuilder.h
<https://git.reviewboard.kde.org/r/117544/#comment38686>

    to be honest, I hate the return-argument pattern. Can you return a struct { DeclarationPointer decl; AbstractType::Ptr type; } instead?



duchain/contextbuilder.cpp
<https://git.reviewboard.kde.org/r/117544/#comment38687>

    nitpick: the rest of the code always uses braces also for one-line-long ifs, please do so here too.


- Sven Brauch


On April 13, 2014, 2:28 p.m., Denis Steckelmacher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117544/
> -----------------------------------------------------------
> 
> (Updated April 13, 2014, 2:28 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-qmljs
> 
> 
> Description
> -------
> 
> This patch adds support variables whose types become known only after an assignation, like in "var a; a = 3;". When a variable is assigned multiple values, the types of all the expressions assigned to the variable are merged into an unsure type.
> 
> ExpressionVisitor and ContextBuilder::findType are modified in order to return the last declaration corresponding to the type of an expression, if any. For instance, "a" is an expression of type int and its corresponding declaration is the "var a;" of the previous paragraph. This is needed because there is no way to find the declaration that "owns" a type, as it is possible for context.
> 
> 
> Diffs
> -----
> 
>   duchain/contextbuilder.h d53b2fe 
>   duchain/contextbuilder.cpp 350ff0c 
>   duchain/declarationbuilder.h 532bb56 
>   duchain/declarationbuilder.cpp 5594616 
>   duchain/expressionvisitor.h da35686 
>   duchain/expressionvisitor.cpp 049e68f 
>   tests/files/helloworld.js 83c121b 
> 
> Diff: https://git.reviewboard.kde.org/r/117544/diff/
> 
> 
> Testing
> -------
> 
> This patch adds one unit test.
> 
> 
> Thanks,
> 
> Denis Steckelmacher
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140413/e5006fae/attachment.html>


More information about the KDevelop-devel mailing list