mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Actual use location information when looking for local variables.
This addresses the bulk of <rdar://problem/15344950>, which involes us not being able to find local variable declarations in expressions when the parser didn't pre-bind them for us. The fix to name lookup itself insures that a case such as case (var a, a) doesn't allow the second 'a' to find the first. Swift SVN r9858
This commit is contained in:
@@ -280,8 +280,10 @@ struct FindLocalVal : public StmtVisitor<FindLocalVal> {
|
||||
if (!IntersectsRange(S->getSourceRange()))
|
||||
return;
|
||||
for (auto Label : S->getCaseLabels()) {
|
||||
for (auto P : Label->getPatterns())
|
||||
checkPattern(P);
|
||||
for (auto P : Label->getPatterns()) {
|
||||
if (!IntersectsRange(P->getSourceRange()))
|
||||
checkPattern(P);
|
||||
}
|
||||
}
|
||||
visit(S->getBody());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user