Commit 366b4c2e authored by Roberto Raggi's avatar Roberto Raggi

Look at the virtual methods.

parent 67227437
......@@ -345,7 +345,22 @@ struct CanonicalSymbol
{
const QList<LookupItem> results = typeOfExpression(code, scope, TypeOfExpression::Preprocess);
for (int i = 0; i < results.size(); ++i) { // ### TODO virtual methods and classes.
for (int i = results.size() - 1; i != -1; --i) {
const LookupItem &r = results.at(i);
if (! r.declaration())
break;
else if (! r.declaration()->scope())
break;
else if (! r.declaration()->scope()->isClassScope())
break;
if (Function *funTy = r.declaration()->type()->asFunctionType())
if (funTy->isVirtual())
return r.declaration();
}
for (int i = 0; i < results.size(); ++i) {
const LookupItem &r = results.at(i);
if (r.declaration())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment