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

Denis Steckelmacher steckdenis at
Sun Apr 13 16:07:46 UTC 2014

This is an automatically generated e-mail. To reply, visit:

(Updated April 13, 2014, 4:07 p.m.)


This change has been marked as submitted.

Review request for KDevelop.

Repository: kdev-qmljs


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.


  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 



This patch adds one unit test.


Denis Steckelmacher

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the KDevelop-devel mailing list