Code completion for overrides: don't suggest to override members from outer

nominals in inner nominals


Swift SVN r16890
This commit is contained in:
Dmitri Hrybenko
2014-04-26 20:08:11 +00:00
parent 6da5c57926
commit df60e7751e
2 changed files with 19 additions and 15 deletions

View File

@@ -1852,9 +1852,7 @@ public:
}
}
void addDesignatedInitializers() {
Type CurrTy = CurrDeclContext->getInnermostTypeContext()
->getDeclaredTypeInContext();
void addDesignatedInitializers(Type CurrTy) {
if (!CurrTy)
return;
const auto *NTD = CurrTy->getAnyNominal();
@@ -1878,9 +1876,11 @@ public:
}
void getOverrideCompletions(SourceLoc Loc) {
lookupVisibleDecls(*this, CurrDeclContext, TypeResolver.get(),
/*IncludeTopLevel=*/false, Loc);
addDesignatedInitializers();
Type CurrTy =
CurrDeclContext->getInnermostTypeContext()->getDeclaredTypeInContext();
lookupVisibleMemberDecls(*this, CurrTy, CurrDeclContext,
TypeResolver.get());
addDesignatedInitializers(CurrTy);
}
};