D14818: Fix ClassNameReferences.

Sven Brauch noreply at phabricator.kde.org
Fri Aug 17 10:48:47 BST 2018

brauch added a comment.

  Good amount of tests :) For the actual implementation, I would suggest trying to make it a bit more readable by a) splitting it up into several functions and b) trying to reduce indent depth a bit by using continue instead of nested ifs.


> expressionvisitor.cpp:708
> +void ExpressionVisitor::visitClassNameReference(ClassNameReferenceAst* node)
> +{

This is a really long function. Can you break it up a bit to make it clearer what's going on?

> expressionvisitor.cpp:723
> +        } else {
> +            m_result.setType(AbstractType::Ptr());
> +        }

Is it intended that you use a null type pointer here?

> expressionvisitor.cpp:767
> +
> +                        if (declaration) {
> +                            context = declaration->internalContext();

here with a bit of if (!declaration) { continue; } I think the code could be much more readable. This has too much indent for my taste.

  R52 KDevelop: PHP Support


To: pprkut
Cc: brauch, kdevelop-devel, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180817/af5927c7/attachment.html>

More information about the KDevelop-devel mailing list