@@ -160,13 +160,13 @@ void UsableFilteringDeclConsumer::foundDecl(ValueDecl *D,
160
160
}
161
161
162
162
switch (reason) {
163
- case DeclVisibilityKind::LocalVariable :
163
+ case DeclVisibilityKind::LocalDecl :
164
164
case DeclVisibilityKind::FunctionParameter:
165
165
// Skip if Loc is before the found decl if the decl is a var/let decl.
166
166
// Type and func decls can be referenced before its declaration, or from
167
167
// within nested type decls.
168
168
if (isa<VarDecl>(D)) {
169
- if (reason == DeclVisibilityKind::LocalVariable ) {
169
+ if (reason == DeclVisibilityKind::LocalDecl ) {
170
170
// Workaround for fast-completion. A loc in the current context might be
171
171
// in a loc
172
172
auto tmpLoc = Loc;
@@ -240,7 +240,7 @@ void UsableFilteringDeclConsumer::foundDecl(ValueDecl *D,
240
240
return ;
241
241
242
242
switch (shadowingReason) {
243
- case DeclVisibilityKind::LocalVariable :
243
+ case DeclVisibilityKind::LocalDecl :
244
244
case DeclVisibilityKind::FunctionParameter:
245
245
// Local func and var/let with a conflicting name.
246
246
// func foo() {
@@ -251,7 +251,7 @@ void UsableFilteringDeclConsumer::foundDecl(ValueDecl *D,
251
251
// So, for confilicting local values in the same decl context, even if the
252
252
// 'var value' is reported after 'func value', don't shadow it, but we
253
253
// shadow everything with the name after that.
254
- if (reason == DeclVisibilityKind::LocalVariable &&
254
+ if (reason == DeclVisibilityKind::LocalDecl &&
255
255
isa<VarDecl>(D) && !isa<VarDecl>(shadowingD) &&
256
256
shadowingD->getDeclContext () == D->getDeclContext ()) {
257
257
// Replace the shadowing decl so we shadow subsequent conflicting decls.
@@ -3967,7 +3967,7 @@ void FindLocalVal::checkStmtCondition(const StmtCondition &Cond) {
3967
3967
if (auto *P = entry.getPatternOrNull ()) {
3968
3968
SourceRange previousConditionsToHere = SourceRange (start, entry.getEndLoc ());
3969
3969
if (!isReferencePointInRange (previousConditionsToHere))
3970
- checkPattern (P, DeclVisibilityKind::LocalVariable );
3970
+ checkPattern (P, DeclVisibilityKind::LocalDecl );
3971
3971
}
3972
3972
}
3973
3973
}
@@ -4017,7 +4017,7 @@ void FindLocalVal::visitForEachStmt(ForEachStmt *S) {
4017
4017
return ;
4018
4018
visit (S->getBody ());
4019
4019
if (!isReferencePointInRange (S->getParsedSequence ()->getSourceRange ()))
4020
- checkPattern (S->getPattern (), DeclVisibilityKind::LocalVariable );
4020
+ checkPattern (S->getPattern (), DeclVisibilityKind::LocalDecl );
4021
4021
}
4022
4022
4023
4023
void FindLocalVal::visitBraceStmt (BraceStmt *S, bool isTopLevelCode) {
@@ -4061,7 +4061,7 @@ void FindLocalVal::visitBraceStmt(BraceStmt *S, bool isTopLevelCode) {
4061
4061
std::function<void (Decl *)> visitDecl;
4062
4062
visitDecl = [&](Decl *D) {
4063
4063
if (auto *VD = dyn_cast<ValueDecl>(D))
4064
- checkValueDecl (VD, DeclVisibilityKind::LocalVariable );
4064
+ checkValueDecl (VD, DeclVisibilityKind::LocalDecl );
4065
4065
D->visitAuxiliaryDecls (visitDecl);
4066
4066
};
4067
4067
for (auto elem : S->getElements ()) {
@@ -4111,15 +4111,15 @@ void FindLocalVal::visitCaseStmt(CaseStmt *S) {
4111
4111
for (const auto &CLI : items) {
4112
4112
auto guard = CLI.getGuardExpr ();
4113
4113
if (guard && isReferencePointInRange (guard->getSourceRange ())) {
4114
- checkPattern (CLI.getPattern (), DeclVisibilityKind::LocalVariable );
4114
+ checkPattern (CLI.getPattern (), DeclVisibilityKind::LocalDecl );
4115
4115
break ;
4116
4116
}
4117
4117
}
4118
4118
}
4119
4119
4120
4120
if (!inPatterns && !items.empty ()) {
4121
4121
for (auto *vd : S->getCaseBodyVariablesOrEmptyArray ()) {
4122
- checkValueDecl (vd, DeclVisibilityKind::LocalVariable );
4122
+ checkValueDecl (vd, DeclVisibilityKind::LocalDecl );
4123
4123
}
4124
4124
}
4125
4125
visit (S->getBody ());
0 commit comments