Commit 5daa0e61 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Use the last visible symbol if available.

parent 8caff494
......@@ -489,7 +489,7 @@ bool ResolveExpression::visit(CallAST *ast)
Symbol *lastVisibleSymbol = result.lastVisibleSymbol();
if (NamedType *namedTy = ty->asNamedType()) {
if (ClassOrNamespace *b = _context.classOrNamespace(namedTy->name(), lastVisibleSymbol->scope())) {
if (ClassOrNamespace *b = _context.classOrNamespace(namedTy->name(), lastVisibleSymbol)) {
foreach (Symbol *overload, b->lookup(functionCallOp)) {
if (Function *funTy = overload->type()->asFunctionType()) {
if (maybeValidPrototype(funTy, actualArgumentCount)) {
......@@ -534,7 +534,7 @@ bool ResolveExpression::visit(ArrayAccessAST *ast)
addResult(arrTy->elementType().simplified(), lastVisibleSymbol);
} else if (NamedType *namedTy = ty->asNamedType()) {
if (ClassOrNamespace *b = _context.classOrNamespace(namedTy->name(), lastVisibleSymbol->scope())) {
if (ClassOrNamespace *b = _context.classOrNamespace(namedTy->name(), lastVisibleSymbol)) {
foreach (Symbol *overload, b->lookup(arrayAccessOp)) {
if (Function *funTy = overload->type()->asFunctionType()) {
Function *proto = instantiate(namedTy->name(), funTy)->asFunctionType();
......
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