mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Eliminate the 'Module' variant from UnqualifiedLookupResult.
Make unqualified lookup always provide a declaration for the things it finds, rather than providing either a module or a declaration. Unify various code paths in our type checker now that module declarations come in with the other declarations. Swift SVN r28286
This commit is contained in:
@@ -1330,24 +1330,22 @@ public:
|
||||
UnqualifiedLookup lookup(ctx.getIdentifier(Tok.getText()),
|
||||
&REPLInputFile, nullptr);
|
||||
for (auto result : lookup.Results) {
|
||||
if (result.hasValueDecl()) {
|
||||
printOrDumpDecl(result.getValueDecl(), doPrint);
|
||||
printOrDumpDecl(result.getValueDecl(), doPrint);
|
||||
|
||||
if (auto typeDecl = dyn_cast<TypeDecl>(result.getValueDecl())) {
|
||||
if (auto typeAliasDecl = dyn_cast<TypeAliasDecl>(typeDecl)) {
|
||||
TypeDecl *origTypeDecl = typeAliasDecl->getUnderlyingType()
|
||||
->getNominalOrBoundGenericNominal();
|
||||
if (origTypeDecl) {
|
||||
printOrDumpDecl(origTypeDecl, doPrint);
|
||||
typeDecl = origTypeDecl;
|
||||
}
|
||||
if (auto typeDecl = dyn_cast<TypeDecl>(result.getValueDecl())) {
|
||||
if (auto typeAliasDecl = dyn_cast<TypeAliasDecl>(typeDecl)) {
|
||||
TypeDecl *origTypeDecl = typeAliasDecl->getUnderlyingType()
|
||||
->getNominalOrBoundGenericNominal();
|
||||
if (origTypeDecl) {
|
||||
printOrDumpDecl(origTypeDecl, doPrint);
|
||||
typeDecl = origTypeDecl;
|
||||
}
|
||||
}
|
||||
|
||||
// Print extensions.
|
||||
if (auto nominal = dyn_cast<NominalTypeDecl>(typeDecl)) {
|
||||
for (auto extension : nominal->getExtensions()) {
|
||||
printOrDumpDecl(extension, doPrint);
|
||||
}
|
||||
// Print extensions.
|
||||
if (auto nominal = dyn_cast<NominalTypeDecl>(typeDecl)) {
|
||||
for (auto extension : nominal->getExtensions()) {
|
||||
printOrDumpDecl(extension, doPrint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user