Commit e8fc8503 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Don't search for the canonical symbol in the base classes (at least for now).

parent bb263645
......@@ -504,10 +504,12 @@ void LookupContext::expand(Scope *scope,
Symbol *LookupContext::canonicalSymbol(Symbol *symbol)
{
Symbol *canonical = symbol;
for (; symbol; symbol = symbol->next()) {
if (symbol->name() == canonical->name())
canonical = symbol;
}
return canonical;
}
......@@ -516,35 +518,16 @@ Symbol *LookupContext::canonicalSymbol(const QList<Symbol *> &candidates)
if (candidates.isEmpty())
return 0;
Symbol *candidate = candidates.first();
if (candidate->scope()->isClassScope() && candidate->type()->isFunctionType()) {
Function *function = 0;
for (int i = 0; i < candidates.size(); ++i) {
Symbol *c = candidates.at(i);
if (! c->scope()->isClassScope())
continue;
else if (Function *f = c->type()->asFunctionType()) {
if (f->isVirtual())
function = f;
}
}
if (function)
return canonicalSymbol(function);
}
return canonicalSymbol(candidate);
return canonicalSymbol(candidates.first());
}
Symbol *LookupContext::canonicalSymbol(const QList<QPair<FullySpecifiedType, Symbol *> > &results)
{
QList<Symbol *> candidates;
QPair<FullySpecifiedType, Symbol *> result;
foreach (result, results) {
foreach (result, results)
candidates.append(result.second); // ### not exacly.
}
return canonicalSymbol(candidates);
}
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