Skip to content

Commit 7626eb1

Browse files
committed
AST: Use getSelfTypeInContext() consistently in typo correction
We actually want to not use types at all here and instead refactor this code to use the various decl-level requests instead... but for now lets be consistent between typo corrections inside function and type context.
1 parent 4942018 commit 7626eb1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/AST/LookupVisibleDecls.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,11 +1014,11 @@ void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
10141014
}
10151015
}
10161016
} else if (auto ED = dyn_cast<ExtensionDecl>(DC)) {
1017-
ExtendedType = ED->getDeclaredTypeInContext();
1017+
ExtendedType = ED->getSelfTypeInContext();
10181018
if (ExtendedType)
10191019
BaseDecl = ExtendedType->getNominalOrBoundGenericNominal();
10201020
} else if (auto ND = dyn_cast<NominalTypeDecl>(DC)) {
1021-
ExtendedType = ND->getDeclaredTypeInContext();
1021+
ExtendedType = ND->getSelfTypeInContext();
10221022
BaseDecl = ND;
10231023
}
10241024

test/IDE/complete_where_clause.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ protocol P2 {
127127
}
128128

129129
// P2: Begin completions
130-
// P2-DAG: Decl[GenericTypeParam]/CurrNominal: Self[#Self#];
131-
// P2-DAG: Decl[AssociatedType]/CurrNominal: T;
132-
// P2-DAG: Decl[AssociatedType]/CurrNominal: U;
130+
// P2-DAG: Decl[GenericTypeParam]/Super: Self[#Self#];
131+
// P2-DAG: Decl[AssociatedType]/Super: T;
132+
// P2-DAG: Decl[AssociatedType]/Super: U;
133133
// P2: End completions
134134

135135
// U_DOT: Begin completions

0 commit comments

Comments
 (0)