mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[refactoring] Fix error when renaming nested type at constructor - init() has no declaration location
Resolves SR-11077
This commit is contained in:
@@ -784,7 +784,7 @@ bool RefactoringActionLocalRename::performChange() {
|
||||
CursorInfoResolver Resolver(*TheFile);
|
||||
ResolvedCursorInfo CursorInfo = Resolver.resolve(StartLoc);
|
||||
if (CursorInfo.isValid() && CursorInfo.ValueD) {
|
||||
ValueDecl *VD = CursorInfo.ValueD;
|
||||
ValueDecl *VD = CursorInfo.CtorTyRef ? CursorInfo.CtorTyRef : CursorInfo.ValueD;
|
||||
llvm::SmallVector<DeclContext *, 8> Scopes;
|
||||
analyzeRenameScope(VD, DiagEngine, Scopes);
|
||||
if (Scopes.empty())
|
||||
@@ -3352,7 +3352,7 @@ int swift::ide::findLocalRenameRanges(
|
||||
Diags.diagnose(StartLoc, diag::unresolved_location);
|
||||
return true;
|
||||
}
|
||||
ValueDecl *VD = CursorInfo.ValueD;
|
||||
ValueDecl *VD = CursorInfo.CtorTyRef ? CursorInfo.CtorTyRef : CursorInfo.ValueD;
|
||||
llvm::SmallVector<DeclContext *, 8> Scopes;
|
||||
analyzeRenameScope(VD, Diags, Scopes);
|
||||
if (Scopes.empty())
|
||||
|
||||
Reference in New Issue
Block a user