Difference in DUContext::findDeclarations() when using QualifiedIdentfier instead of Identifier

Milian Wolff mail at milianw.de
Sat Sep 26 13:12:58 UTC 2009


Hi there!

I just spotted some unexpected behavior in the DUChain:

I have a function, with some arguments (e.g. arg1, arg2). The 
DUContext::Function type context gets imported in the internalContext() of the 
function declaration.

Now I can do e.g.:

funcDec->internalContext->findDeclarations(Identifier("arg1"))

And that will find me the declaration of arg1. So far so good.

But when I change the above to use QualifiedIdentifier, instead of Identifier, it 
doesn't work anymore.

How come?

Example:

    foreach ( Declaration* arg, funcDec->internalFunctionContext()-
>localDeclarations() ) {
        QList<Declaration*> decs = funcDec->internalContext()-
>findDeclarations(arg->qualifiedIdentifier());
        QCOMPARE(decs.size(), 1);
    }

I'd expect that this works, but it doesn't. the decs list is always empty. If 
I use arg->identifier() it works though...

David, can you explain that?

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090926/2bfa7b22/attachment.sig>


More information about the KDevelop-devel mailing list